HN Hall of Fame Weekly email

A history of branch prediction

danluu.com Essays & writing Essays & articles Computer science Candidate
Screenshot of danluu.com captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 6 calendar years, with breakout response in 2 of them.

submissions
9
submitters
8
observed span
2017–2026
peak thread · 65 comments
300 pts
latest 20+ return · 2019-07-01
192 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

The use of previous branch history and branch address as a "context" for prediction reminds me of the very similar technique used for prediction in arithmetic compression as used in e.g. JBIG2, JPEG2000, etc. --- the goal being that, if an event X happens several times in context C, then whenever context C occurs, the probability of X is more likely. Also, since modern CPUs internally have many functional units to which operations can be dispatched, I wonder if, in…

One fun thing to note is that the author doesn’t really talk a lot about anything from this decade, which makes sense considering how much complexity was being added for the tiny improvements towards the end. Modern branch predictors are quite complicated so they can eke out improvements in accuracy by fractions of a percent.

>We also didn’t talk at all about how different workloads affect different branch predictors. Predictor performance varies not only based on table size but also based on which particular program is run. One of my favorite little tradeoffs around this topic is around power usage. This is because, in many cases, adding more hardware (generally) increases total power usage. I.e. adding more execution units makes the processor faster at the expense of increased power usage. Good branch predictors, however, are…

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
527

reference only — not used in Hall rules or ranking

Total comments
101

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2017-08-23A history of branch predictionFirst breakout · Best threaddarwhy30065
2019-05-09Branch Predictionnuriaion180
2019-07-01How and why CPUs do “branch prediction” (2017)Latest 20+ point returnmajke19233
2021-05-24Branch Predictionpta200210
2022-02-14Branch Predictionibobev50
2022-12-28Branch Predictionibobev20
2022-12-31CPU branch prediction evolution over yearsKeyframe62
2024-07-29Branch Prediction (2017)tambourine_man10
2026-03-15Branch Predictionbirdculture21