3 ms·
Optimizer's Anonymous – The deceptive performance of simple programs
- mcphage 11y agoThe author makes the point that, as compilers get more efficient, they'll optimize thing you don't realize, so optimization before profiling is pointless. And I think they're right, but they could probably go further—as compilers get more efficient, even if we know the bottleneck, it might be impossible to know how to optimize a bit of code, since you can't understand what the compiler will do with the code you give it. I'm not sure how I feel about that.
- SamReidHughes 11y agoEven without SIMD, the "naive" version would compile into using two conditional move instructions, the way the attempted optimization ends up with a conditional move in one of its branches. SIMD or not, the superiority of the "naive" version is the sort of outcome you could guess, if you were better at guessing.