Hacker News new | ask | show | jobs
by layer8 95 days ago
I think it’s making a case that normally you shouldn’t even bother benchmarking it, unless you know that it’s in a critical hot path.
2 comments

Agreed. Nitpicking about indirection is definitely a "premature micro-optimization is the root of all evil" moment.

When I worked on Firefox, we eventually had to remove a bunch of indirection (the interested can actually search bugzilla.mozilla.org for deCOMtamination for some instances of this), but that project wasn't a thing until there was clear evidence that there were problems with virtual function calls on hot paths.

I must add that code is on the hot path only under two conditions:

- the application is profiled well enough to prove that some piece of code is on the hot path

- the developers are not doing a great job