4 ms·
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 millis
by kevindong 4y 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.
- marginalia_nu 4y agoDunno, 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.
- zaphar 4y agoIf your hot loop is doing configuration setup then your code has bigger problems than this particular pattern.
- marginalia_nu 4y agoYou could also be configuring many things.
- saturn_vk 4y agoIndeed, but you should probably do that right before looping
- marginalia_nu 4y agoRight, but if you needed to configure a million different things, wouldn't you also loop the configuration process?