Hacker News new | ask | show | jobs
by epolanski 546 days ago
Well, the issue is that micro benchmarking in JS is borderline useless.

You can have some function that iterates over something and benchmark two different implementations and draw conclusions that one is better than the other.

Then, in real world, when it's in the context of some other code, you just can't draw conclusions because different engines will optimize the very same paths differently in different contexts.

Also, your micro benchmark may tell you that A is faster than B...when it's a hot function that has been optimized due to being used frequently. But then you find that B which is used only few times and doesn't get optimized will run faster by default.

It is really not easy nor obvious to benchmark different implementations. Let alone the fact that you have differences across engines, browsers, devices and OSs (which will use different OS calls and compiler behaviors).

1 comments

I guess I've just never seen any alternative to microbenchmarking in the JS world. Do you know of any projects that do "macrobenchmarking" to a significant degree so I could see that approach?
Real world app and some other projects focus on entire app benchmarks.