How many branches can your CPU predict?

AMD remembers 30k moves, Apple hits 10k, Intel forgets at 5k — comment section explodes

TLDR: A new test says AMD’s chip can “remember” far more branching decisions than Apple’s and especially Intel’s, stirring jokes and side-eyes at Intel. Commenters clash over whether the benchmark is meaningful or just memorization, with pros reminding everyone that chip design is a game of trade‑offs—and real apps don’t live in labs.

The silicon soap opera is back, and the plot twist is brutal: in Daniel Lemire’s post, AMD’s Zen 5 “remembers” about 30,000 decisions in a row, Apple’s M4 clocks 10,000, and Intel’s Emerald Rapids taps out near 5,000. Translation for non-nerds: the part of the chip that guesses your next “if” statement is either an elephant (AMD), a decent goldfish (Apple), or… well, Intel’s catching strays. The comments? A riot. One developer claimed real-world slowdowns on Intel until switching to “branchless” code, while others dropped memes about CPUs predicting your coffee order.

But the crowd is split. Some say this is a party trick—because the test repeats the same “random” values, the chip can just memorize the pattern. “That’s the point,” others fire back: real programs often repeat patterns, and good guesses mean speed. A voice of calm insists there are trade-offs—making the predictor bigger costs precious chip space and speed elsewhere. Another hot take: using truly random values makes all predictors look dumb, so what does this even prove? Meanwhile, a confused onlooker points out the code only has one visible “if”—so how is the CPU learning thousands of decisions? Drama aside, everyone agrees: benchmarks can mislead, and Intel’s result is the headline, but the debate is the show.

Key Points

  • Branch prediction is crucial for sustaining high instruction throughput in modern CPUs.
  • A benchmark using a repeated sequence of random values allows the branch predictor to memorize outcomes.
  • The test measures how many branch outcomes different CPUs can learn with perfect accuracy.
  • Results: AMD Zen 5 memorizes 30,000 branches; Apple M4 memorizes 10,000; Intel Emerald Rapids memorizes 5,000.
  • Small or repeatable datasets can yield misleading benchmark results due to predictor learning.

Hottest takes

"strangely lower performance on Intel vs. AMD" — withinboredom
"Intel is more constrained for one reason or another" — stephencanon
"Using random values defeats the purpose" — rayiner
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.