hyperfine
$ hyperfine Community Med Riskhyperfine measures command execution latency with warmup runs, outlier detection, and statistical summaries. Agents use --export-json and --style basic to compare implementations objectively without flaky one-off time readings.
brew install hyperfine Benchmarking local scripts and binaries happens directly in the workspace shell via hyperfine.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --export-json, --export-markdown, --style basic, and zero-prompt execution.
- Structured
--export-jsonmetrics and--style basicnon-ANSI mode
Executes arbitrary shell command arguments repeatedly; safe when benchmarking read-only commands, risky if pointed at mutating scripts.
- Repeatedly runs supplied shell commands through
sh -cunless-Nis set
Single Rust binary on brew, cargo, apt, and Windows.
- Cross-platform static binary
Replaces error-prone manual time loops with statistically sound warmup and comparison.
- Automatic warmup, outlier detection, and relative speedup summary
Maintained under sharkdp/hyperfine with widespread engineering adoption.
- Active OSS repo under MIT / Apache-2.0
Clear README and --help covering --prepare, --cleanup, and export formats.
- Detailed README and built-in
--help
Security, Auth & Guardrails
None required; executes local benchmark commands only.
100% free, offline, and open-source (MIT / Apache-2.0).
# hyperfine Agent Rules - Cap iterations with `--runs` (e.g. `5` or `10`) on slow commands so benchmarks finish within shell timeouts. - Only benchmark idempotent or side-effect-isolated commands; never benchmark destructive writes without `--prepare` / `--cleanup`.
Agent-Ready Command Recipes
Safe Read-Only Queries
hyperfine --warmup 2 --runs 5 --style basic 'rg -l TODO src/' 'grep -rl TODO src/'
Runs 2 warmups and 5 timed runs with plain terminal styling (--style basic).
Controlled Writes & Previews
hyperfine --warmup 2 --runs 5 --export-json /tmp/bench.json 'rg -l TODO src/'
Writes mean, median, stddev, and individual run timings to /tmp/bench.json.
Strengths for Agents
- + Produces rigorous statistical comparisons and
--export-jsonartifacts. - + Supports
--style basicand-N(no shell) for clean, deterministic benchmarking.
Caveats & Pitfalls
- ! Commands run multiple times by default—must bound with
--runsand avoid unisolated side effects.