Why is processing a sorted array faster than processing an unsorted array?

Summary: It’s not the cache. It’s your CPU’s branch predictor.
Sorting turns a coin-flip branch into one long, predictable run, slashing…