The author demonstrates up to 40x performance swings in a tight C summation loop caused solely by where the binary is loaded in memory — same source, compiler, flags, and CPU. Using perf stat, they show L1 cache misses, DSB hits, and branch mispredictions fluctuating based on factors the programmer cannot directly control, concluding that a one-off benchmark tells you almost nothing about the code itself.
The editorial contextualizes the post as reigniting an argument microbenchmark authors have been losing for a decade. It points to Intel's optimization manuals warning about loop alignment for twenty years, Emery Berger's 2013 Stabilizer paper formalizing measurement noise, and production pipelines like Google's AutoFDO and Meta's BOLT that were rebuilt around this reality — along with LLVM's -falign-loops flag existing precisely because of this issue.
The editorial argues that while alignment noise used to be a 5-10% story you could squint past ten years ago, it has grown into a much larger effect on today's chips. Massive out-of-order windows, aggressive prefetchers, and increasingly opaque microarchitectural state on modern Intel and AMD CPUs have amplified the gap between what programmers write and what actually gets measured.
A blog post by tiki.li titled *"Your code is fast – if you're lucky"* hit the Hacker News front page this week and reignited an argument that microbenchmark authors have been losing for a decade: on modern hardware, the code you wrote is a small input to the number you measure. The rest is alignment, cache state, branch history, and whatever the OS scheduler was doing three milliseconds ago.
The post walks through a minimal C loop — a tight sum over an array — and shows performance swings of up to 40x across runs that differ only in where the binary was loaded in memory. Same source. Same compiler. Same flags. Same CPU. The author demonstrates the effect using `perf stat`, showing that L1 cache misses, DSB (Decoded Stream Buffer) hits, and branch mispredictions all fluctuate wildly based on nothing the programmer controls directly.
The uncomfortable conclusion: a benchmark you ran once, on your laptop, in isolation, is telling you almost nothing about the code — and almost everything about the roll of the dice that particular run represented.
This isn't new to the people who write compilers or design CPUs. Intel's optimization manuals have warned about loop alignment for twenty years. Emery Berger's *Stabilizer* paper (2013) formalized the problem: performance measurements on modern hardware are dominated by environmental noise, and most published speedups in academic PL research fail to survive when you randomize layout. The AutoFDO and BOLT teams at Google and Meta rebuilt entire binary-optimization pipelines around this reality. LLVM's `-falign-loops` flag exists exactly because someone got tired of shipping a 15% regression every time a coworker added a function above `main`.
What *is* new is how large the variance has gotten. Ten years ago, alignment noise was a 5–10% story you could squint past. On modern Intel and AMD chips — with their massive out-of-order windows, aggressive prefetchers, and increasingly opaque frontend caches — it's now routinely a 2–3x story, and in pathological cases like the one in the post, a 40x one. The CPU has become so good at making average code fast that when it fails, it fails catastrophically, and it fails for reasons the programmer cannot see from the source.
The HN discussion split predictably. One camp — mostly systems engineers who've been burned — treated the post as required reading and added their own war stories: benchmarks that flipped ordering when a comment was added, hot loops that got 30% slower after an unrelated string literal shifted the .text section, CI runs where the "fast" version was slow every third Tuesday. The other camp pushed back that the effect is overstated for real workloads, since production code runs long enough that the CPU frontend eventually converges. Both are right. The frontend does converge — for steady-state workloads. Microbenchmarks are, by definition, not steady state.
Daniel Lemire, who has published more benchmarks than most of the commenters combined, has argued for years that a benchmark reported as a single number is closer to a lie than to data. His prescription — repeated runs, distribution reporting, hardware counter checks — is exactly what the post advocates. It's also exactly what almost no blog-post benchmark you'll read this year actually does.
There's a deeper industry issue underneath. A lot of the "Rust is 2x faster than Go" / "this new allocator is 30% faster" / "our framework beats theirs" content that drives adoption decisions is built on exactly the kind of single-run microbenchmark that this post demolishes. That doesn't mean the underlying claims are wrong — Rust *is* generally faster than Go for CPU-bound work, and better allocators *do* win on real workloads. It means the numbers being cited are, statistically, garbage, and the fact that they happen to point in a defensible direction is partly luck.
If you write microbenchmarks — or, more importantly, if you make decisions based on them — three practical changes are worth making.
First, stop reporting minimums or single runs. Run the benchmark 100 times, report the distribution: median, p95, p99, and the spread. If your "20% speedup" lives inside the noise floor of your baseline, it isn't a speedup. Tools like `hyperfine` (with `--runs 100 --warmup 10`) or `criterion` in Rust give you this out of the box. Google Benchmark can too if you configure it. There is no excuse in 2026 to publish a single number.
Second, actually look at what the CPU is doing. `perf stat -d` on Linux takes ten seconds to set up and will tell you more about why your code is slow than any amount of staring at the source. Cache-miss rate, branch-misprediction rate, IPC, frontend stalls — these are the numbers that explain the wall-clock time. If your "faster" version has the same IPC and cache behavior as the original, you didn't optimize anything; you got lucky. LLVM-MCA and `llvm-mca` for static analysis of hot loops are underused for the same reason.
Third, randomize what you can't control. For CI-based performance regression testing, jitter the binary layout across runs (Stabilizer-style, or just link with `-Wl,--randomize-section-addresses` on supported linkers) so that layout noise averages out across your test matrix instead of biasing individual runs. Meta's HHVM team has been doing versions of this for years; the tooling has gotten dramatically better and cheaper to adopt.
The harder pill is cultural. A lot of engineering-blog performance content is written to be shared, and distributions don't share as well as "we made it 10x faster." If you're an engineering leader, the highest-leverage thing you can do about this is stop rewarding the single-number version and start asking "what's the p99 and what does `perf` say?" every time someone shows up with a graph.
None of this gets easier. The next generation of chips — with even wider issue widths, more aggressive value prediction, and increasingly heterogeneous core layouts (P-cores, E-cores, big.LITTLE on servers now, not just phones) — will make single-run benchmarks even less predictive of anything. The winners will be the teams that treat performance as a statistical property of a distribution rather than a scalar attached to a commit. The losers will keep shipping "2x faster" posts and quietly wondering why production never sees the win. Same code, same CPU, different luck — the industry is going to spend the next decade catching up to a fact the hardware has been screaming at us since Haswell.
Top 10 dev stories every morning at 8am UTC. AI-curated. Retro terminal HTML email.