Why I do not believe microbenchmark
I think that this one screenshot of a real - life performance measurement is enough to convey the meaning of the article, but if the reader is interested in my thoughts on this subject, then welcome.
Programmers are obsessed with the speed of program execution. We follow the speed even where this speed is not very important. Sometimes contrary to common sense and logic. Not even fully understanding what the words “speed” or “performance” really mean in each particular case. We still want the fastest hardware, the fastest language, and the lightest framework.
I readily believe that you, username, are not like that. That you yourself are able to write the right benchmark, you know how this or that runtime works, you hate speed optimization just for the sake of speed optimization and you know a lot about hardware. But there are more people from the previous paragraph. Checked.
Seeing the example in the picture above, I first choked coffee ...
Instead of comparing languages, we get a micro-competition on sports programming.
By the way, how long have you seen someone write a similar code, and he was reviewing? Solid, OOP and OP here and does not smell. The code is written explicitly in a procedural style. Because his task is different. Understand correctly, although the code solves the problem, it requires refactoring before production. And it is unknown how refactoring will affect performance. But this is probably a niggle.
With an example sorted out. Obviously, the example is inadequate.
But let's see how other programming languages passed the same test.
What do you think, how correct is it to conclude that Swift is faster than Go? I think that is wrong. It suffices to see that the two implementations on Rust (2 and 6 line) differ in time by 2 times.
It turns out that the benchmark code needs to be checked closely.
Question: When was the last time you saw a person who climbs to double-check how the code of benchmarks was written right after seeing standard beautiful graphics of performance?
I meet these very rarely. I think that such engineers are vanishingly small.
On the other hand, there are many examples before our eyes, when on the basis of such tests a conclusion is drawn about the performance and lightness of the technology. And, by the way, public opinion is forming.
Do you still trust the results? Me not.
That's all. But there is good news. The programmer's skill still strongly influences program performance.
Microbenchmarks will not show you anything if you are not a professional in performance for a specific platform. And even better, you yourself write these benchmarks taking into account your requirements and conditions, while understanding what you are doing.
post is written as a response to hasty comparisons and conclusions about future performance. Of course, all the conclusions and arguments from the article can be cited without this example, but with numbers and specifics it is more fun and clearer.
Only registered users can participate in the survey. Sign in , please.