LIVE SUBMISSIONS — 3 DAYS

Which HFTU Challenges Got Faster in a Move From Zen 2 to Zen 5

Published: December 01, 2026 | Announcements Benchmarking & Profiling CPU & Microarchitecture


Which HFTU Challenges Got Faster in a Move From Zen 2 to Zen 5

Every trading shop has run this experiment at least once. The new server generation arrives, someone rebuilds the hot path with -march=native, runs the benchmark, sees the median drop by a fifth, and the box goes into the rack. Nobody asks the second question, which is whether the code that was fastest on the old machine is still the fastest on the new one, because usually there is only one version of the code to ask it about.

We have 576 versions. On 26 November I took the best ranked solution of every member on every challenge on this site, 131 people and 33 challenges, and ran each one again on a second machine: an AWS EPYC 9R45, Zen 5, against the Zen 2 box that certifies every score here. Same container image, same compiler, same private benchmarks, clocks fixed on both machines so that a cycle count means the same thing on each.

So the question here is the one nobody gets to ask at work. If you tuned a data structure hard for one core, how much of that tuning survives a move to a core five years newer? Does the board keep its order?

Mostly it does, and the median entry runs 17% faster per cycle on Zen 5 (about 15% fewer cycles). But the gain is not spread evenly. On the order books, the schedulers and the seqlock, the slowest third of each board gained the most, up to 1.88x fewer cycles, while the fastest third ended up between 5% fewer cycles and 22% more, and on three of those boards it lost. On the lookup and string boards it went the other way, and the fastest designs pulled further ahead.

Two boxes held still

The certified box is hz2, a Ryzen 9 3900: twelve Zen 2 cores in four CCXs of three, each CCX with 16 MB of L3. Benchmarks run on isolated cores 6 to 11. The Zen 5 box is an AWS c8a.metal-24xl spot instance in us-east-1: 96 cores in twelve CCXs of eight, 32 MB of L3 each, one NUMA node, twelve channels of DDR5-6400, kernel 7.0.0-1018-aws. Both run with boost off. On hz2 I checked it again on 30 November: scaling_min_freq and scaling_max_freq both read 3100000 on every isolated core and /sys/devices/system/cpu/cpufreq/boost reads 0, so the cores sit at the 3.1 GHz TSC rate. The EPYC's isolated cores are held at its 2.6 GHz base, which is also its TSC rate.

That last detail is the reason the comparison works at all. The harness counts with the TSC. With boost on, a TSC tick is a fixed slice of wall time while the core runs at whatever frequency the firmware picked, so a "cycle" on one machine would be a different unit from a "cycle" on the other. With the core clock pinned to the TSC rate on both, every score is real core cycles, and the ratio of the two scores for one submission is how much more or less work per cycle the newer core did on that code.

hz2 Zen 5 box
CPU Ryzen 9 3900, Zen 2 (2019) EPYC 9R45, Zen 5 (2024, a custom Turin part)
clock in these runs 3.1 GHz, boost off 2.6 GHz, boost off
L1D / L2 per core 32 KB / 512 KB 48 KB / 1 MB
L3 per CCX 16 MB, 3 cores 32 MB, 8 cores
L3 hit 38-39 cycles 48 cycles
widest vector unit AVX2, 256-bit AVX-512, 512-bit datapaths
compiler g++ 14.2, rustc nightly 2026-03-31 same image

The L3 latencies come from the pointer-chase ladder in the CCX article, which ran on the same EPYC 9R45 instance type a day earlier. The image is the sandbox image hz2 builds every submission in, saved on hz2 and copied to the EPYC; both report the digest 3d762e68…. Every entry is compiled on the box that runs it with -march=native, so the Zen 5 build is allowed AVX-512 and the Zen 2 build is not. That is deliberate. Nobody ships a Zen 2 binary to a Zen 5 server, and a comparison that forbade the compiler from using the new machine would be measuring the wrong thing.

The core layout took one wrong first attempt. The harness pins its threads by their position in /sys/devices/system/cpu/isolated rather than by core number, so the cross-CCX ring's two threads land on positions 0 and 5. On hz2, with 6 to 11 isolated, that is cores 6 and 11, CCX 2 and CCX 3. The script that sets up the EPYC for article work isolates 8 to 95, which puts positions 0 and 5 on cores 8 and 13, the same CCX, and the cross-CCX benchmark would have become a same-CCX benchmark without any error. The rounds box isolates exactly 8-10 and 16-18 instead, the same three-plus-three shape as hz2, so position 5 is core 18 in the next CCX.

Entries ran one at a time, in the same no-network sandbox the certified runs use. The launch round started at 18:20 UTC on 26 November and finished at 23:28, 619 runs including our 33 baselines, in 4.99 hours of spot time at $1.379 an hour.

How much one run moves

Every score in this article is a single run, on both machines, so before reading any ratio it helps to know how far a single run wanders. Challenges Pro entries are re-run on the EPYC every Monday, Wednesday and Friday, and three of those rounds (26, 27 and 30 November) ran the same 75 entries, each round on a fresh spot instance. Across the pairs of rounds, the same submission's score moved by a median of 0.1% to 0.9%, the 90th percentile was 5% to 7%, and the worst pair differed by 19%.

So a ratio between 0.93 and 1.07 for one entry is a tie, and I treat it as one. A board median over 20 or 40 entries is much steadier than that. I have no repeated hz2 runs of these exact submissions to put next to the EPYC's spread, which is the main hole in this method; hz2's certified scores are themselves single runs. I expect hz2 to be the quieter of the two, since it is our own machine and its benchmark cores are isolated the same way every day, but I have not measured it for this set.

Scores are whole cycles. On the boards whose best entries are in single digits (Ticker Lookup, Fast Integer-to-String, Feed Arbiter, and Build Optimization II, where everybody scores 4 or 5) a ratio like 1.25 can be one cycle, and I read those rows loosely.

Board by board

Median hz2/Zen 5 cycle ratio per board, with the 10th to 90th percentile of the board's entries; the dashed line marks the ratio at which the two boxes take the same wall time at 3.1 and 2.6 GHz

Across all 576 entries the median ratio is 1.17. 74% of the entries needed fewer cycles on Zen 5 and 22% needed more. For C++ alone the median is 1.16 over 488 entries; for Rust it is 1.24 over 88, but twelve of the thirteen Rust boards have between three and nine entries, which is too few to say Rust gained more than C++.

Per cycle is the fair comparison and it is not the one a desk feels. At the clocks of this run, Zen 5 at 2.6 GHz needs a ratio of 3.1/2.6 = 1.19 just to tie hz2 in nanoseconds, and only 47% of the entries clear that line. The CCX article also ran this EPYC with boost on, at 4.5 GHz, so the wall-time line says something about these two settings and little about what a production Zen 5 box does in nanoseconds.

The flags-only board is the cleanest control in the set. On Build Optimization the code is frozen and members choose only the compiler flags, so every entry is the same source built differently. Its ratios sit in a band from 1.49 to 1.61, the narrowest on the site: when the code is identical for everyone, the machine change is close to a constant. Its rank correlation is only 0.82, because the board is crowded (the median entry is within 8% of the best one) and small shifts reorder neighbours.

At the bottom of the chart are the boards that run two threads, and they need more cycles on Zen 5. The cross-CCX ring is at 0.83, the seqlock at 0.86. I come back to both below.

Who gained

The more useful split is inside each board. For the 19 boards with ten or more entries (leaving out Build Optimization II and its 4-or-5-cycle scores), I divided each board into thirds by hz2 score and took the median ratio of each third.

third of the board, by hz2 score entries median ratio interquartile range
fastest 171 1.11 0.95-1.34
middle 167 1.10 0.97-1.25
slowest 155 1.23 1.12-1.48

Pooled, the slowest third gained most. Board by board the picture has two halves, and the pooled number hides which half a board belongs to.

Per board of 10 or more entries, the median ratio of the third that was fastest on hz2 against the third that was slowest

On ten boards the slow third gained more, and they are the order books, the two schedulers, the rings and the seqlock, plus the FIX Encoder and the Monte Carlo pricer. The Multi-Symbol Order Book is the extreme: its slowest third needs 1.88x fewer cycles on Zen 5, its fastest third 1.03x, a tie. On the Rust Order Book the fastest third got slower, 0.88, while the slowest gained 1.39. On the C++ Order Book, the board with 101 entries, the best score is 14 cycles per operation on hz2 and the best on Zen 5 is 16.

My reading of the book and scheduler boards, which I have not checked against counters: a slow design spends its cycles on branch mispredictions and on cache misses over a structure larger than Zen 2's 32 KB L1 and 512 KB L2, and Zen 5's 48 KB and 1 MB, together with a better predictor and a wider back end, take a large part of that away. A tuned design already fits in cache and already avoids the unpredictable branches. What it has left is a short chain of dependent loads, and a load that hits L1 costs 4 cycles on both cores; the L2 costs 14 cycles on Zen 5 against 12 on Zen 2. There is nothing in the new core for that chain to gain from. If this is right, the tuned books were already at a floor that five years of core design did not lower, and the slow ones were nowhere near it.

On the other nine boards the fast third gained more: Ticker Lookup (1.60 against 1.09), String Map (1.61 against 1.21), Fast Integer-to-String (1.38 against 1.03), Feed Arbiter, Rolling Counter, FIX Parser, Build Optimization, Memory Triathlon and, by two hundredths, Implied Book. On the first three the best designs found something that Zen 5 does better per cycle than Zen 2 and the slow designs did not. These challenges are open, and the solutions are the members' work, so I will not say what that something is. It is enough to say that a ranking on these boards is a little less portable than a ranking on the books: the leaders gained more, so the board stretched out, but it kept its order.

Two threads on one CCX

The seqlock board is the one that changed the most. Its median ratio is 0.86, only 4 of the hz2 top ten are in the Zen 5 top ten, none of the top three stayed in the top three, and the rank correlation between the two machines is -0.11, which is no correlation at all. The fastest third's median ratio is 0.82, 22% more cycles on Zen 5; the slowest third's is 1.20.

Both threads of the seqlock run on one CCX on both machines, positions 0 and 1, so every write the reader sees is a cache line handed from one core to another inside a CCX. The CCX article measured that handoff on this EPYC at 173 cycles, against about 95 on a Zen 2 core, while the L3 hit only grew from 38 to 48 cycles. A benchmark made of handoffs, on a core where each handoff costs 80% more cycles, should get slower per cycle, and the tuned entries, which have removed everything except the handoffs, should get slower the most. That is what happened.

The SPSC ring is the case that keeps me from calling this settled. It is also two threads on positions 0 and 1, also a stream of lines handed across, and its median gained 14%, with the leader changing and 7 of the top ten kept. The obvious difference between the two is how many lines cross per operation and how often a thread waits on one, and I have not counted either.

The cross-CCX ring is the third two-thread board, with its threads in different CCXs, and it needs 20% more cycles on Zen 5 (a median ratio of 0.83, with every third of the board below 1). On the CCX article's numbers I would have predicted the opposite. A handoff between CCXs on the EPYC was 130 to 156 ns at 2.6 GHz, roughly 340 to 400 cycles, where the Zen 2 desktop part took 150 to 195 ns at 3.8 GHz, 570 to 740 cycles. Per cycle the crossing got cheaper and the benchmark built on crossings got more expensive. I do not know why. A guess is that the score includes more than the crossing itself, the same-CCX traffic on each side for example, and that part got dearer as in the seqlock; I have not separated the two.

Memory Triathlon also needs more cycles on Zen 5 (0.92), and its slowest third the most (0.69). I have not looked into why.

The entry that did not build

One launch-round entry did not build at all. It sets its target to Zen 2 with a #pragma GCC target, and a -march=native build on Zen 5 then fails with an inlining error, because GCC will not inline a function compiled for the wider Zen 5 target into one restricted to Zen 2. Tuning for one CPU in the source is a choice with a cost on the next CPU, and here the cost was a build failure.

What a move to a new core keeps

Fourteen of the 20 boards with ten or more entries have a rank correlation of 0.95 or more between the two machines, and two more are above 0.9. If your code is among the fastest on one Zen generation, it is very likely among the fastest on the next. The three boards where the leader changed are the seqlock, the SPSC ring and the Rust Order Book, and the first two are the threaded ones.

What does not transfer is the size of the lead. On the books, a design that was twice as slow as the best on Zen 2 is a lot closer on Zen 5, because the new core forgives the mistakes that made it slow and does nothing for the design that made none. On the lookups the opposite happens. A median that improves by 17% when the new box arrives says very little about either. The number to look at when the hardware changes is your own code's ratio next to the board's, and that needs a board.

The board

From Tuesday 1 December at 13:00 UTC every challenge leaderboard has a Zen 5 tab, public, with each member's best score from the launch round next to the same submission's certified hz2 score, the ratio and the date of the round. Every member with a ranked entry was run once, for the launch. From now on the rounds on Monday, Wednesday and Friday re-run Challenges Pro members only, with both their best and their latest submissions, so their rows stay current and the rest keep the 26 November date. Zen 5 results are not certified and carry no badges for now; hz2 remains the box that certifies.

The Order Book board, with 101 entries, is the place to start: hftuniversity.com/challenge/order-book/leaderboard/zen5.

Review quiz

Pass it to mark this article as read and count it toward your reading achievements.

Five questions about this article. Get four right to pass: a passed quiz earns the green double check on the article lists and counts toward the reading achievements. Review quizzes come with a membership.

Log in See membership

Back to Courses
155 reads 0

Comments

No comments yet. Be the first to share your thoughts.

Log in as a member to comment, or subscribe to join the discussion.