

Optimizer's Anonymous – The deceptive performance of simple programs - ScottWRobinson
https://nopointerexception.wordpress.com/2015/07/16/optimizers-anonymous-1st-step-is-admitting-you-probably-dont-have-a-problem/

======
mcphage
The 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
Even 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.

