Re:Mispredicted branches can multiply your running times
by toast0 on Wednesday October 16, 2019 @12:11PM
(#21271985)
> Let's not drastically increase job requirements for no good reason.
Here's the short version of branch predictor awareness. If you can write your inner loop with fewer conditionals, it will probably perform better.
Is it relevant and worth doing? At some level, only if your loop is frequent and fairly tight -- otherwise the difference is likely to be in the noise. On the other hand, writing your code to avoid branches in general can be a reasonable style and get you in the right place by default.
Everybody is claiming to be a 'Full Stack' developer these days, but apparently that doesn't include much of the stack.
Here's the short version of branch predictor awareness. If you can write your inner loop with fewer conditionals, it will probably perform better.
Is it relevant and worth doing? At some level, only if your loop is frequent and fairly tight -- otherwise the difference is likely to be in the noise. On the other hand, writing your code to avoid branches in general can be a reasonable style and get you in the right place by default.
Everybody is claiming to be a 'Full Stack' developer these days, but apparently that doesn't include much of the stack.