Size a micro-benchmark so one run takes 300 milliseconds
matklad's rule for micro-benchmarks: tweak the input until one run takes about 300 milliseconds, keeping results readable and free of fixed-cost noise.
matklad’s rule for sizing a micro-benchmark is to tweak the input until one run takes about 300 milliseconds. The target is deliberate, and the reasoning transfers to any benchmark you write.
Start with readability. At hundreds of milliseconds, every result is an integer between 1 and 999. That is enough precision to catch a small improvement and easy to scan by eye. You never juggle units or squint at a decimal point; comparing 1.31s with 239ms takes a beat, while a column of three-digit millisecond numbers reads at a glance.
Next, the noise floor. Below roughly 10ms, fixed costs start to dominate the measurement. Interpreter startup, process spin-up, a one-off allocation: those overheads skew a short run, and the usual remedy is to measure and subtract them, which adds machinery that is itself less reliable. At hundreds of milliseconds the per-run overhead becomes a rounding error, so you can ignore it without any special handling.
Third, human perception. Hundreds of milliseconds is fast but still noticeable, so keeping the number in that range lets you use your own sense of time instead of relying only on the digits. The payoff is concrete: watching a sluggish CLI command become “instant” after an optimization pass tells you something the raw figure alone does not.
Fourth, iteration speed. Past a second, the benchmark itself becomes the bottleneck. If you want to run it ten times in a row to eyeball the variance, each run has to be cheap, and 300ms lets you do that in a few seconds.
Underneath all four reasons sits one assumption that matklad states plainly: the purpose of this kind of benchmarking is to give the author enough intuition to make a correct decision about a change, not to produce a precise measurement of performance. Size the benchmark for the human reading it, and hundreds of milliseconds is where the number stays both readable and resistant to noise.
Keep Reading
quantizationFour bits, then a cliff
Benchmarks show Qwen3.8 27B keeps full quality at 4-bit but collapses to random-guess scores at 1-bit, with guidance on which quant to run locally.
N-able4EverAble2Shell Collapsed the Patch Window
4EverAble2Shell reached active exploitation within hours, compromising N-central servers running the latest Hotfix 2 release.
reverse engineeringAn agent reads raw x86 and writes Markdown
A reverse engineer with two decades of experience describes the agent-assisted workflow they now use to disassemble binaries and build custom firmware.
Latest on the Wire
Full wire →- Anthropic's 2028 Power Mix: 87% Gas, 11% CoalHacker News
- Cleverbridge Data Breach Exposes Payment Card Details, CVVsBleepingComputer
- Fast-Anything: Port only slow code to Rust for performance gainsHacker News
- FBI investigates apparent breach of criminal databaseHacker News
New signal daily · RSS
Stay in the loop
New writing delivered when it's ready. No schedule, no spam.