To add, to avoid any misunderstanding: the cost is probably within 1-10% in likely scenarios on most real world code.<p>Pathological case would be code with a lot of taken branches mixed with range&#x2F;overflow checks.<p>For range checks, any sane compiler would generate code that doesn&#x27;t branch if the value is in range. If no branch predictor entry is present, branches are assumed [1] to be not taken. These branches can still thrash BTB (kind of cache trashing) and cause taken branches that fell out of BTB to become always mispredicted, thus very expensive.<p>[1]: Some architectures do support branch hints, even x86 did so in the past. Modern x86 CPUs simply ignore these hints.