Command-line benchmarking tool that runs statistical analysis across multiple timing runs of shell commands
hyperfine is a command-line benchmarking tool that performs statistical analysis across multiple runs of shell commands. It automatically determines the optimal number of runs (minimum 10) and measurement duration (minimum 3 seconds) to produce reliable timing statistics. The tool supports comparing multiple commands side-by-side and provides statistical outlier detection to identify interference from other programs or caching effects.
The tool includes advanced features for controlling benchmark conditions. Users can configure warmup runs to test with hot caches, or use preparation commands to clear caches before each timing run. Parameterized benchmarks allow testing across ranges of values, such as varying thread counts or input sizes. hyperfine corrects for shell spawning overhead by measuring shell startup time and subtracting it from results, or can run commands directly without an intermediate shell for very fast operations.
hyperfine exports results to multiple formats including CSV, JSON, Markdown, and AsciiDoc. The JSON output integrates with Python analysis scripts included in the repository for creating histograms and whisker plots. The tool runs on Linux, macOS, and Windows, supporting arbitrary shell commands and custom shell environments.
# via Homebrew
brew install hyperfine
# via apt
apt install hyperfine
# via Cargo
cargo install --locked hyperfine


