Mispredicted branches can multiply your running times
https://lemire.me/blog/2019/10/15/mispredicted-branches-can-multiply-your-running-times/ [lemire.me]
2019-10-16 00:27
Could the compiler have solved this problem on its own? In general, the answer is negative. Sometimes compilers have some options to avoid branches entirely even if there is an if-then clause in the original code. For example, branches can sometimes be replaced by “conditional moves” or other arithmetic tricks. However, there are tricks that compilers cannot use safely.
source: L