Bypassing the branch predictor
A couple of days ago I was thinking about what you can do when the branch predictor is effectively
working against you, and thus pessimizing your program instead of optimizing it.
Let’s work with something relatively simple & concrete: consider that we want to write some kind of
financial system (maybe a trading system) and all of our transaction requests arrive at a certain
function before being either (a) sent out to some authoritative server, or (b) abandoned. Let’s
also assume that:
The vast...
Read more at nicula.xyz