News for hackers. Stuff that matters.
Re:Anti-if: The Missing Patterns by hvidgaard on Friday June 10, 2016 @03:52AM (#11874865)
The performance cost of ifs are not that bad. Especially if it means you can read sequentially from the memory.

It however, do represent branching, and in a hotspot it can be more efficient to simply calculate both the if and the else and just choose the right value, rather than having a branch misprediction.

In any case, always profile, and identify issues before doing any optimization.

There are no comments on this comment yet.