Re:Crystal vs. Node.js vs. Golang vs. Julia vs. Rust vs. Lua...
by leovonl on Thursday December 22, 2016 @12:36PM
(#13238843)
If you compile the Rust example with optimization (-O) it just throws the result away, which gives the ~0.030 time chrisdouay found.
However, if you add a println!() around it, it has to calculate the result. Here's the running time:
> time ./fib
1134903170
real 0m2.242s
user 0m2.240s
sys 0m0.000s
I tried the C example as well (with -O2) and found this:
> time ./cfib
1134903170
real 0m4.671s
user 0m4.670s
sys 0m0.000s
So.. which one is faster again?
This "comparison" unfortunately seems too naïve to not be on purpose - no analysis, no real discussion, not even some reasoning about the defaults and why the big difference in numbers. It seems to be just looking for views/comments (even if negative) without any intention to produce real content. What worries me are the ones that will take this for a real benchmark and just "share on facebook" and spread more disinformation.
Re:Crystal vs. Node.js vs. Golang vs. Julia vs. Rust vs. Lua...
by steveklabnik on Wednesday December 21, 2016 @04:42PM
(#13232882)
How was this stuff compiled? There's no way to reproduce these numbers without compiler flags, at least.
For example, with "rustc fib.rs", I get 10 seconds as a runtime. With "rustc -O fib.rs", to turn on optimizations, I get 0.034s. This makes me pretty sure that they did not turn on optimizations, which means the Rust numbers are very misleading, and possibly, the other languages as well.
Re:Crystal vs. Node.js vs. Golang vs. Julia vs. Rust vs. Lua...
by chrisdouay on Wednesday December 21, 2016 @04:47PM
(#13232927)
I get 0.034s => this means the compiler run the code and puts directly the result in the binary file. So, when you run the binary, it only println(result)
Re:Crystal vs. Node.js vs. Golang vs. Julia vs. Rust vs. Lua...
by rubyfan on Wednesday December 21, 2016 @04:36PM
(#13232837)
I don't love the conclusion, a single Fibonacci benchmark is fairly light evidence to blanket state Crystal is as fast as C. It's also fairly toothless on comparison of other languages.
However, if you add a println!() around it, it has to calculate the result. Here's the running time:
I tried the C example as well (with -O2) and found this: So.. which one is faster again?This "comparison" unfortunately seems too naïve to not be on purpose - no analysis, no real discussion, not even some reasoning about the defaults and why the big difference in numbers. It seems to be just looking for views/comments (even if negative) without any intention to produce real content. What worries me are the ones that will take this for a real benchmark and just "share on facebook" and spread more disinformation.
For example, with "rustc fib.rs", I get 10 seconds as a runtime. With "rustc -O fib.rs", to turn on optimizations, I get 0.034s. This makes me pretty sure that they did not turn on optimizations, which means the Rust numbers are very misleading, and possibly, the other languages as well.