4 ms·
Doesn’t that get mostly optimised away by the cpu branch prediction?
by cm2187 3y ago
Doesn’t that get mostly optimised away by the cpu branch prediction?
- beagle3 3y agoThe branch does, but you still have the comparison itself, and also the branch instruction to decide and skip (although thanks to branch prediction, your pipeline doesn’t get flushed). If you have enough idle execution units, you might not see a difference in wall clock time. But with many algorithms you can put those units to good use.
- yxhuvud 3y agoThe branch does, but not optimizations that could be done, like vectorization.