Branch prediction forecasts which control-flow path a conditional branch will take, helping the processor keep execution supplied. Predictable patterns run faster than irregular ones, so secret-dependent branches can make runtime vary with data. section 10.5
Summing values above a threshold
A C loop summing values above 500 runs two to three times faster on a sorted 100-million-element array than on an unsorted array of the same size. Sorting produces long runs of not-taken and taken branches, while unsorted data produces an irregular pattern. section 10.5
Avoid data-dependent control-flow variation when constant-time behavior matters:
- Replace the conditional branch with a conditional move where appropriate; CMOV updates a value according to a comparison without diverging into separate code paths. section 10.5

