Ten months later, this is the latest article in the "Ef speed test" series.
I recently accidentally saw this webpage (or here) Evaluate the speed of each scripting language, and I also tested EF. To be honest, I am a little embarrassed to compare the compiled language EF with a bunch of dynamic scripting languages, fortunately, there are also C and Java (EF should be a programming language similar to Java ).
C vc6: 0.22 secondds 1.00 x
EF 1.0 Public Beta (efide 0.2.2): 0.35 seconds 1.59 x
EF's performance can be ranked at the top three, slightly lower than C, but higher than Java, much higher than Lua, Python, Perl, TCL, PHP, JavaScript, Ruby and so on.
In the original article, C code (with gcc-4.0.1 compilation, O3 option optimization) took only 0.05 seconds, while on my machine with vc6 compilation (without special optimization settings), took up to 0.22 seconds, this may be related to compilation optimization and machine performance. No special optimization settings are made when compiling EF code.
The following is the EF code:
Introduction tool; <br/> public class startup class <br/>{< br/> Public static startup () <br/>{< br/> int starttime = runtime environment. start Time (); <br/> int X, Y; <br/> for (y =-39; y <39; y ++) {<br/> console. output ("/N"); <br/> for (x =-39; x <39; X ++) {<br/> int I = Mandelbrot (x/40.0, Y/40.0); <br/> if (I = 0) <br/> console. output ("*"); <br/> else <br/> console. output (""); <br/>}< br/> console. output ("/N"); </P> <p> int elapsedtime = runtime environment. start Time ()-starttime; <br/> console. output line ("Ef elapsed", elapsedtime); <br/> console. input text (); <br/>}</P> <p> const int comment lout = 16; <br/> const int max_iterations = 1000; </P> <p> static int Mandelbrot (Double X, Double Y) <br/>{< br/> double Cr = Y-0.5; <br/> double CI = x; <br/> double Zi = 0.0; <br/> double Zr = 0.0; <br/> int I = 0; </P> <p> while (true) {<br/> I ++; <br/> double temp = Zr * Zi; <br/> double zr2 = Zr * Zr; <br/> double zi2 = Zi * Zi; <br/> Zr = zr2-zi2 + CR; <br/> Zi = temp + ci; <br/> If (zi2 + zr2> bailout) <br/> return I; <br/> if (I> max_iterations) <br/> return 0; <br/>}< br/> return 0; <br/>}< br/>}
An external question: 0.35 seconds? In English, do you want to add s to second? If the value is equal to 1, it is a singular number. If the value is greater than 1, it is a plural number. If the value is less than 1, is it a singular number or a plural number?