Cloudflare
Cloudflare logoCloudflare · Feature trail

Branch Prediction Performance

1 post · May 2021

What this trail covers

Cloudflare's understanding of branch prediction performance has evolved, moving beyond the general rule that predictable branches have near-zero cost. Experiments have revealed that the cost of branches, even unconditional ones, can increase significantly with their number and density. This has led to a deeper investigation into the Branch Target Buffer (BTB) and its capacity, demonstrating that performance degrades when the number of branches exceeds certain thresholds (e.g., 4096 branches). This understanding informs code optimization strategies to avoid performance penalties associated with excessive branching.

All Cloudflare trails