---
name: lie-detector
license: MIT
compatibility: Needs a shell to run the measurement commands.
description: Measures performance, timing, size, share, ranking and unused-code claims about software itself, with a warm-up, repeated runs, median and spread, a machine-load check and runtime values taken from the running app and not from test fixtures. Use when about to report or confirm that something is faster, slower, smaller, under a time limit, the largest, a given share of a folder or bundle, a frame rate, a load time, or unused or dead code. For a single fixed fact that can be read directly (a line count, one file's size) one command is enough and no repetition applies. It does not review other people's claims or reports.
metadata:
  author: "Jakob Christensen"
  source: "https://jakobchristensen.com"
---

# Numbers skeptic

Goal: every number in a report was measured by you, repeated where it varies, and comes from the thing that actually runs. A guess from names or sizes is not a measurement.

## Steps

1. **Name the claim and the unit** in one line: "median request time under 200 ms", "bundle is 40 percent smaller", "folder X is the largest". Decide which command or tool will measure it. If it cannot be measured here (no GPU, no credentials, production-only traffic, no runnable build), write verdict "not checked" with the missing prerequisite and do not build a proxy benchmark. For a UI number (frame rate, load time, interaction delay) use the browser's own timing or a performance trace on the real page, visible and in the foreground. For a flaky test report passes out of runs, not a median. For a network-bound number record the cache state and say the network was not controlled.
2. **Take the value from the real thing.** A runtime value (a scale, a size, a speed, a limit) comes from the function or setting the running app uses, never from a test fixture, a default or a mock. If you build a mock-up or a comparison on such a value, check it against one value you can read independently in the running app (the rendered size of a known element, a logged number, a file's real byte size) and show the two numbers side by side before anyone sees it.
3. **Check the machine first and again afterwards.** Note what else runs: other builds, servers, browsers, indexing, a battery or power-saver mode. Close what you started and can close. If the project has an integration lock (in a git repository with parallel worktrees, a lock file such as `integrate.lock` in the git common dir), check whether an integration is running: if so, wait for its end instead of for low CPU, with a fixed limit of 30 minutes. After that measure anyway and mark the result "under load", never wait without end. Do not change the power plan, the CPU governor or other system settings to get a cleaner number. Report the state instead. Read the load with one command before the series and again right after it: on Linux or macOS `uptime` next to the core count (`nproc` or `sysctl -n hw.ncpu`, wait a minute after your own build, because `uptime` is an average over minutes), on Windows `(Get-CimInstance Win32_Processor | Measure-Object -Property LoadPercentage -Average).Average` (a one-second reading, so take a few a second apart). A load above half the cores (Windows: above 50 percent) counts as high. This threshold is a rule of thumb, not a measured limit. If the load is high, say so next to the result. If you could not read it, write "load not measured". Note the PID of every process you start and stop only those PIDs, never by name (no `pkill`, `killall`, `taskkill /IM`). A dev server that was already running stays running. Never leave a measurement tool or load generator you started running afterwards.
4. **Make sure the command is safe to repeat, then warm up and repeat.** A command you run many times must not write outside a scratch folder, change a database, deploy, install packages, send anything or consume a quota. Never load-test, benchmark or repeat-run a command that calls a shared, remote or paid service (mock it locally or mark "not checked"). If it changes state, reset the state between runs or mark "not checked". Discard one or two warm-up runs (caches, JIT, cold disk). For commands that take 0.1 to 10 seconds, run five measured repetitions. For faster commands loop the command inside one timed run so that a run lasts at least 100 ms, or use a timing tool that picks the count (hyperfine, `Measure-Command` in a loop). If the ratio (max - min) / median is above 0.10, add up to five more runs once, then stop and report the result as noisy. If one run takes over 10 seconds use three runs and say "few runs". If one run takes over 2 minutes, or the series including the second series of step 6 would take over 10 minutes, run it once, mark the verdict "seen once" and say that a repeat needs the user's go-ahead (ask only if the user is present). Deterministic values (sizes, counts) are read once.
5. **Report the statistic the claim names**, plus median, minimum, maximum and the number of runs, computed with a tool (an inline one-liner is enough, no helper file left in the repository), not by hand. If a tool prints the mean first, take the median from the raw samples. A median cannot confirm a percentile claim: for p95 or p99 collect at least 100 samples, otherwise write "not checked, too few samples". Never report the best run as the result. Write the machine and its load state in one line.
6. **Call it reproduced only after a repeat run.** The repetitions of step 4 are one run. A second, separate series (a new process, load checked again) that gives the same verdict is the repeat. One run that shows an effect is "seen once". A cause counts as shown when the code shows it or a controlled change toggles the effect. Until then write "probably".
7. **Judge a difference against the noise.** A difference smaller than the larger of the two spreads is "no difference measured".
8. **Use the same conditions on both sides.** Before and after use the same inputs, the same build mode, the same cache state (cold or warm), the same dependency lockfile, the same machine state, and, where it is a UI, the same viewport and the same single open tab. Record the git commit or version of each side. Change one thing at a time. When comparing two versions, alternate them (A B A B ...) instead of running all of A and then all of B, so a drift in machine load hits both sides. If you cannot alternate (one side needs a rebuild), say so and mark the result "order not balanced".
9. **Measure sizes, shares and rankings, do not estimate them.**
- Sizes: count or sum with a tool (`du`, a file listing, a bundle analyzer), not from folder names.
- Shares and "most" or "largest": compute the total and each part, show the numbers, then rank.
- "Unused", "dead" or "never called": search for the name in code, tests, config, scripts, build files and docs, and for the pieces it could be built from (a prefix, a suffix, a config key that holds it). If it is a public export or something outside this repository may load it, you cannot call it unused: write "no use found in this repo" and name what you could not see. Where a coverage tool or a runtime log exists, use its result as the evidence and state its limits.
10. **Report** a table: claim, how measured, runs, the claimed statistic and the median, spread, machine state, verdict (confirmed, seen once, not reproduced, not checked). Every benefit a recommendation promises is a claim and gets its own row. Measure it briefly or mark it "not checked". Never merge "not checked" into "fine".
