language-bench

Methodology

Everything is meant to be checkable. Every number on this site links to the raw iterations behind it, the exact source code, the build flags and the CI run that produced them.

From raw data to a number

  1. Raw: every kernel iteration and every end-to-end repetition, stored in data/sessions and downloadable per benchmark as raw.csv on its page.
  2. Per session: cold = first iteration, warm = median after the first 2 s, end-to-end = median of the repetitions.
  3. Per machine: a machine factor from benchmarks that ran in several sessions (below).
  4. Per benchmark: geometric mean over sessions of (session median ÷ machine factor), with a bootstrap interval; the index divides it by the fastest benchmark of the same problem.

Every benchmark page walks through these four steps with its own numbers, in a table you can check against the raw CSV.

What is a benchmark?

A benchmark is a unique combination of language version (for example Bun 1.4), build setting (compiler, flags, runtime options; for example bun) and problem (for example Binary Trees). Each is measured many times:

How one benchmark is timed

Every language has one harness that all its problems share; a problem implementation only decodes an instance and solves it. The harness contract fixes the clock, the loop and the output, and a conformance test on a dummy problem checks every harness in CI.

Fair play

Statistics

Iterations in one session share the same VM and are correlated, so sessions are the independent samples. Iterations reduce noise within a session; they do not remove the systematic effect of a particular machine. We handle that effect statistically, without any calibration program:

  1. Per session: median, MAD, mean, standard deviation, min and max of the iterations (the warm ones for kernel time). Outliers (beyond 3 scaled MADs) are flagged but never removed.
  2. Machine factors from overlapping benchmarks: because the same benchmark is measured in several sessions, the speed difference between two machines is visible. Think of it as asking, for every machine, “how much longer does the same program take here than elsewhere?”. Formally, we fit log(time) = benchmark + machine to all sessions simultaneously (alternating least squares): each time is explained as the benchmark's own difficulty plus a per-machine offset, on a log scale so that offsets become multiplicative factors. The machine factor says how much slower or faster a session's VM was than the average machine. This corrects for different CPU models and for slow or fast hosts on a given day. It assumes a machine is uniformly faster or slower across workloads; memory-bound and compute-bound workloads can scale differently, which shows up as residual noise.
  3. Operating-system effect: GitHub's ubuntu-latest image changes over time (Ubuntu 24 today, Ubuntu 26 from October 2026), and a different kernel or libc can favour some workloads (file I/O, process start-up, memory allocation) more than others. Every session records its OS image. The model gets one extra term, log(time) = benchmark + machine + os[image, problem], shared by all sessions on the same image, so many sessions on one image pin down its effect together. The term is shrunk towards zero and centred per problem: a general speed shift of an image stays in the machine factors, and only the workload-specific deviation is attributed to the OS. With a single image the term is zero.
  4. Across sessions: each benchmark's time on the average machine is the geometric mean of (session median ÷ machine factor ÷ OS factor). The 95% confidence interval comes from a cluster bootstrap (1000 iterations, deterministic seed) that resamples sessions, then iterations within each session. At most 100 evenly spaced iterations per session enter the bootstrap.
  5. Index vs fastest = time of a benchmark divided by the time of the fastest benchmark on the same problem (whichever language, release or build that is, so the baseline is not always C), with a bootstrap interval for the ratio. Composite scores over several problems are geometric means of indices.
  6. Memory is the time-weighted average memory of the timed kernel regions (and the peak), averaged over sessions; for the start-up task, the mean peak resident set size of hyperfine's runs.
  7. Does the correction work? The validation page shows how much the same benchmark disagrees between sessions before and after it.
  8. Benchmarks that are not (yet) linked to the main group of sessions through shared benchmarks, or that have fewer than 3 sessions, are labelled provisional.

Data and reproducibility

Everything is stored append-only in data/: one sessions/<session>.json file per session with its full environment (hardware, OS, kernel, Docker, hyperfine, runner image, trigger, scheduler decisions) and every measurement of that session: the kernel time of every iteration (so cold, warm and the whole warm-up curve), memory statistics and flags, the wall-clock, CPU, memory and exit-code values of the end-to-end run from hyperfine's JSON export, build and run commands and the source hash. Derived numbers are never stored; they are computed when the site is built using the open statistics code, which is unit-tested on synthetic data with known machine factors. You can re-run any benchmark locally with Docker.

Limits