hyperfine

Command-line benchmarking tool that runs statistical analysis across multiple timing runs of shell commands

install

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.

Installation

# via Homebrew
brew install hyperfine
# via apt
apt install hyperfine
# via Cargo
cargo install --locked hyperfine

hyperfine benchmarking fd vs find commands

Runtime histogram visualization

Whisker plot comparison

Alternatives & related tools

add a badge to your README

Maintain hyperfine? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/hyperfine.svg)](https://www.trmn.sh/tools/hyperfine?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/hyperfine?utm_source=badge"><img src="https://www.trmn.sh/badge/hyperfine.svg" alt="Featured on trmn" height="20"></a>