home / dev-tools / hyperfine

hyperfine

28k

Command benchmarking CLI for comparing shell commands with statistical timing, warmups, parameter scans, and JSON exports.

$brew install hyperfine
Language
Rust
Stars
27,662
Category
Dev Tools
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

hyperfine is a command benchmarking CLI for measuring and comparing how long shell commands take to run. It is used to test performance changes across scripts, builds, queries, and other terminal workflows without writing a custom timing harness.

What It Enables
  • Benchmark one or more shell commands with automatic run counts, warmups, and relative speed comparisons.
  • Add setup, prepare, conclude, or cleanup commands so repeated runs better match real workflows such as cold-cache tests, build steps, or short-lived services.
  • Sweep parameters and export results to JSON, CSV, or markup formats for CI regression checks, reports, and deeper analysis.
Agent Fit
  • Non-interactive flags, stable exit behavior, and --shell=none make it straightforward to benchmark exact commands inside scripts or agent loops.
  • --export-json writes structured results with summary statistics, per-run timings, exit codes, and parameter values, which makes follow-up parsing simple.
  • Best when an agent already knows which commands or variants to compare; hyperfine measures runtime well, but it does not profile internals or explain why something is slow.
Caveats
  • Benchmarks can be skewed by caches, shell startup, background load, or command side effects, so automation often needs warmups or explicit setup and cleanup steps.
  • It runs commands many times, which makes it a poor fit for destructive, stateful, or expensive operations unless the workflow is carefully isolated.