From Branches to Vectors: When Your CPU Stops Guessing and Starts Computing

Your CPU predicts the future. Every time your code hits an if, the processor guesses which way it goes and starts executing that path before the condition is evaluated. When the guess is right, you pay nothing. When it is wrong, the pipeline flushes and restarts. Fifteen to twenty wasted cycles. For most branches, the predictor gets it right over 95% of the time. But some branches resist prediction. Those are the ones worth eliminating — and eliminating them opens a door to something bigger. ...

March 26, 2026 · 10 min · Gracjan Olbinski