Command-line benchmarking tool that performs statistical analysis across multiple runs of shell commands.
hyperfine is a command-line benchmarking tool that measures the execution time of arbitrary shell commands with statistical rigor. It automatically determines the optimal number of runs to perform (minimum 10 runs over at least 3 seconds) and provides statistical analysis including mean, standard deviation, and outlier detection. The tool handles shell spawning overhead by performing calibration runs to measure and subtract shell startup time from results.
The tool supports parameterized benchmarks where you can vary parameters like thread counts or other variables across multiple test runs. It includes options for warmup runs to heat caches, preparation commands to clear caches before each run, and can export results to multiple formats including CSV, JSON, Markdown, and AsciiDoc. Users can specify custom shells or bypass shell execution entirely for very fast commands under 5ms.
hyperfine is particularly useful for developers, performance engineers, and system administrators who need to compare command performance, validate optimizations, or conduct systematic performance analysis. It works across platforms and integrates with tools like Chronologer for Git history analysis and Bencher for continuous benchmarking in CI pipelines.
# via Homebrew
brew install hyperfine
# via apt
apt install hyperfine
# via Cargo
cargo install --locked hyperfine

