Benchmarks That Survive Code Review: Medians, Spread, and a Paste-Ready Table
November 19, 2026 · DevTools
"This version is faster" is not a reviewable claim. "This version has a 1.3 ms median across five runs versus 2.1 ms, with a 0.2 ms standard deviation" is. The Benchmark Builder exists to close that gap: it turns rough timing measurements into a comparable, copy-paste table that travels with your pull request.
Why the median is the default ranking
Timing distributions are noisy and right-skewed. A garbage-collection pause, a scheduler hiccup, or a background tab throttle lands on one run and drags the mean upward, even though every other run was fine. The median is robust against those outliers — it describes what a typical run feels like, which is usually what you're actually claiming. The Benchmark Builder sorts fastest-median first by default and badges the winner, while mean, best run, worst run, and alphabetical order are one select away when the question genuinely calls for them.
Two ways to record a run
Not every benchmark happens inside a tidy harness. The tool accepts run durations two ways:
- Manual entry — type comma, semicolon, or newline separated milliseconds into a candidate. This is the path for numbers you copied out of a script, a CI log, or a profiler.
- Built-in stopwatch — start the timer, run your code wherever it lives, stop, and the
performance.now()delta lands as one run. Repeat until you hit the repeats target you set up front; every candidate shows its progress (runs recorded / target) as you go.
Statistics update live after every entry: median, mean, min, max, and sample standard deviation, with units scaling automatically from nanoseconds to seconds.
Read the spread, not just the center
A 2 ms median with a 9 ms spread loses to a stable 3 ms in anything user-facing, because users feel the tail, not the average. The std dev column is what makes the table honest: a small deviation says the ranking is stable, a large one says you need more runs or a quieter machine. A single run reports 0 rather than an undefined value, which is the tool's way of telling you one sample isn't a benchmark.
The output is a markdown table
The results emit as a markdown table — candidate, runs, median, mean, min, max, std dev — ready to paste into a PR description, README, or issue comment. That last step matters more than it sounds: when the numbers ship with the claim, reviewers can challenge the methodology instead of the vibe, and months later anyone can see what was measured and how.
Sessions persist, measurements stay local
The whole session — candidates, labels, run lists, sort choice — persists locally in your browser, so you can close the tab mid-experiment and resume. Nothing is uploaded; measurements never leave your device, which is exactly what you want when the timings come from unreleased code.
For the theoretical side of the same question — how two algorithms scale as input grows — pair the timings with the Big-O Complexity Comparator. And when a performance change also changes what your code emits, the JSON Diff shows the structural drift between the two versions' output.