Runs repeated timing benchmarks on shell commands, compares results, and exports statistics to several report formats.
Overview
hyperfine is a command-line benchmarking utility for measuring how long commands take to run. You pass one or more commands; it repeats runs, reports means and dispersion, and can compare later commands against the first as a reference.
It supports warmup and per-run preparation steps, parameterized sweeps over numeric or list values, environment variable overrides, and optional shell interpretation for pipes and redirection. Users can choose wall-clock time, CPU time, memory peak, and hardware counter metrics where the platform allows.
The tool detects statistical outliers, shows progress during long suites, and exports results to CSV, JSON, Markdown, AsciiDoc, and related formats for further analysis. Install options include distro packages, Homebrew, MacPorts, Chocolatey, Scoop, Winget, conda, and cargo builds on Linux, macOS, and Windows.
It draws inspiration from the bench tool and integrates with projects that visualize hyperfine JSON over Git history or in CI benchmarking workflows.
Key features
- Statistical analysis across multiple runs
- Compare several commands in one session
- Warmup and prepare hooks per run
- Parameterized and list-based sweeps
- Selectable performance and hardware metrics
- Outlier detection during benchmarks
- CSV, JSON, and Markdown export
- Cross-platform installs
Use cases
- Compare CLI program performance
- Benchmark commands across Git branches
- Measure cold versus warm cache behavior
- Export timing data for plotting
- Tune thread or environment parameters