Empirical Big-O Profiler

Don't reason about the complexity of a function — measure it. This runs your code at geometrically growing input sizes, times each one, and fits the curve.

Your code runs on your machine. It is executed inside a Web Worker built from a blob: URL, on a separate thread from this page. Nothing is uploaded — this demo makes no network requests at all. A runaway function is killed by a 3 s watchdog.

best fit —  
R²
—
exponent p
—
runner-up
—
points
0
idle worker Δ —

time per call vs n

Hover the chart — or focus it and use ← → — to inspect a measurement.

measured fitted model

candidate models

modelfitted form (ms)R²

Relative-error weighted least squares, so small n counts as much as large n. Pick a row to overlay its curve.

measurements

ntreps × trials

t is the fastest of k trials; reps are auto-calibrated so every batch runs ≥ 12 ms.

function under test

Examples — pick one and it profiles itself.

watchdog 3.0 s · worker terminated on overrun