Hacker News new | ask | show | jobs
by kevindong 1492 days ago
Sure the relative difference between the fastest and slowest approach is 5x. But the absolute difference is still just 125.23 ns. For some perspective, 1 millisecond / 125.23 ns = ~7,985.

There certainly are cases where that slowdown matters. But for the vast, vast, VAST majority of applications, it is completely irrelevant.

1 comments

Dunno, it's not unheard of for a program to do the same thing over and over again, sometimes millions of times. Every slow program consists of a bunch of individually fast instructions.
If your hot loop is doing configuration setup then your code has bigger problems than this particular pattern.
You could also be configuring many things.
Indeed, but you should probably do that right before looping
Right, but if you needed to configure a million different things, wouldn't you also loop the configuration process?