|
|
|
|
|
by dagss
549 days ago
|
|
In what context? You are assuming the poster is doing something like your typical IO-bound backend, and not, say, a High Performance Computing simulation on a compute cluster. I have done this kind of optimization to go from 24 hour compute time to 6 hour compute time instead for instance -- per simulation run. How can you say "a few milliseconds" when you know absolutely nothing about the context? I do not consider your advice any better at all; you assume all computer code is in the same context -- it really is not. Not all code is written as backend to websites. You could have said "keep in mind that if you service is IO-bound, these kinds of optimizations are likely a waste" or similar to make the context clear. |
|
I'm sure there are workloads where this kind of optimization makes a lot of sense. But they are comparatively rare. And they are not for free, in terms of code complexity and robustness. So, for the broad masses reading HN, its a premature optimization.
> How can you say "a few milliseconds" when you know absolutely nothing about the context?
Most code that gets written is not performance critical. Programmers would generally be better advised to think about robustness, correctness and maintainability of their code than about cache effects. The world would be a better place and we'd see fewer app crashes and fewer security holes.