News for hackers. Stuff that matters.
Re:Go vs. Node vs. Rust vs. Swift on Ubuntu Linux 15.10 by jerf on Thursday December 10, 2015 @09:50AM (#10710814)
"Beware of Fibonacci as a benchmark."

It seems to me one of the dangers of its use is that people tend to think that it measures "math speed" or "execution speed" or something. But the fib calculation itself is done with small integer addition, things that will be about one cycle in any compiled language, and which is also what I've called "easy mode" for a JIT before. Since the calculation under test is so tiny compared to the overhead, the benchmark is really measuring the overhead, and due to the simplicity of the test, very vulnerable to special purpose optimizations skewing the results vs. what you might expect for real.

This isn't "useless", because that overhead can matter, but unless you have a program that is going to spend an irreducible and large amount of its time being forced to make static function calls only to do tiny amounts of work per function call relative to the function overhead, the information is only a quite tiny part of understanding the performance characteristics of a language. If one has optimized even a half-decently compiled language's program down to where the function call overhead is your biggest problem, one is to be congratulated on some fine engineering, and I expect that you'll know what to do next if you need more speed as you've already demonstrated significant competence.

You want to have a bit more fun, benchmark the local equivalent of "dynamic" dispatch. That'll spread the languages out quite a bit more. For fun, toss in Python or something too.

There are no comments on this comment yet.