Why I do not believe microbench marks

3r33112. Why I do not believe microbench marks 3r3113.  
I think that this one screenshot is really existing 3r3128. 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.
3r3128.
3r3113.  
3r33112. 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.
3r3113.  
3r33112. 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.
3r3113.  
3r33112. Seeing the example in the picture above, I first choked on coffee 3r3113.  
- How can typescript work faster than jаvascript, and at the same time eat several times less memory? 3r3113.  
- No!
3r3113.  
3r33112. Typescript does not have its own runtime. That is, you can not nowhere or
almost
nowhere to run typescript. You need to first copy it into jаvascript, which then run in runtime, which this same jаvascript understands. In this case, node v??? acted as such a runtime. By happy coincidence, the same runtime example runs on a jаvascript example. 3r3113.  
Instead of comparing languages, we get a micro-competition on sports programming.
3r3113.  
3r33112. 3r340. Code on typescript
3r3113.  
jаvascript code
3r3113.  
3r33112. It turns out that the execution time, memory consumption and other characteristics critically depend on who and how this verification code was written. Of course, here you can pull by the ears the argument that typescript
makes
write the "correct code". But no one can prevent compiling typescript in jаvascript, and I didn’t see any places with optimizations either.
3r3113.  
3r33112. By the way, how long have you seen someone write a similar code, and he passed a review? 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.
3r3113.  
3r33112. With an example sorted out. Obviously, the example is inadequate. 3r3113.  
But let's see how other programming languages ​​passed the same test. 3r3113.  

3r3113.  
3r33112. 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.
3r3113.  
3r33112. And here the problem looks more serious. If the comparison of typescript and jаvascript is perceived as a joke, then in the case of other languages ​​the problem is not so obvious. Would you understand what was the matter if you saw such a report? 3r3113.  

3r3113.  
3r33112. It turns out that the benchmark code needs to be closely checked.
3r3113.  
3r33112. Question: When was the last time you saw a person who climbs to double-check how the benchmarks code was written right after seeing standard beautiful graphics of performance? 3r3113.  
I meet these very rarely. I think that such engineers are vanishingly small.
3r3113.  
3r33112. 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. 3r3113.  
Here is here You can compare the performance of the main frameworks in jаvascript. 3r3113.  
3r3113.  
Do you still trust the results? Me not. 3r3113.  
That's all. But there is good news. The programmer's skill still strongly influences program performance.
3r3113.  
3r33112. 3r3105. Conclusion:
3r3113.  
Microbench marks will not show you anything if you are not a professional in performance for a particular platform. And even better, you yourself write these benchmarks taking into account your requirements and conditions, while understanding what you are doing.
3r3113.  
3r33112. P.S .:
 
The post is written as a response to hasty comparisons and conclusions about future performance. Of course, all 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 3r3128. , you are welcome.
3r3-33132.
3r3133.
Do you check the correctness of microbench marks? 3r3188.
3r3142.
3r3144.
3r3146.
3r3148.
3r3151.
3r3181.
3r3183.
3r3204. 3r3187. Yes 3r3188.
3r3190.
3r3193.
3r3181.
3r3183.
3r3204. 3r3187. No 3r3188.
3r3190.
3r3193.
3r3181.
3r3183.
3r3204. 3r3187. I will write in the comments 3r3188.
3r3190.
3r3193.
3r3195.
3r3198.
3r3r2202. 8 users have voted. Abstained 1 user.
+ 0 -

Add comment