# hyperfine

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

Stars: 29.2k · Language: Rust · License: MIT · Categories: Dev Tools

- Repository: https://github.com/sharkdp/hyperfine
- Page: https://www.trmn.sh/tools/hyperfine

## Install

- Homebrew: `brew install hyperfine`
- apt: `apt install hyperfine`
- Cargo: `cargo install --locked hyperfine`

## Overview

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

```bash
# via Homebrew
brew install hyperfine
```

```bash
# via apt
apt install hyperfine
```

```bash
# via Cargo
cargo install --locked hyperfine
```

![hyperfine benchmarking fd vs find commands](https://media.trmn.sh/cached/d56a7927f51574bd895c563112b8adde7bae57ccc0644fb581dec87663a1c134.gif)

![Runtime histogram visualization](https://media.trmn.sh/cached/c4f87a08ac5d3a361db1d7c8cb11f63e0153ff0c2f69e86f9c1da133ae997f30.png)

![Whisker plot comparison](https://media.trmn.sh/cached/68730baa68502b2345bb2cf9c5f60e60d484d676e5e54fca4ab9220a5715aac7.png)

## Alternatives

- [fnm](https://www.trmn.sh/tools/fnm.md): Fast Node.js version manager built in Rust with support for .node-version and .nvmrc files (Rust, 27.3k stars)
- [difftastic](https://www.trmn.sh/tools/difftastic.md): Structural diff tool that compares files based on their syntax rather than lines (Rust, 26.1k stars)
- [mise](https://www.trmn.sh/tools/mise.md): CLI tool for managing development environments with version-controlled tools, environment variables, and tasks (Rust, 35.7k stars)
- [zellij](https://www.trmn.sh/tools/zellij.md): Terminal multiplexer with floating panes, multiplayer collaboration, WebAssembly plugins, and built-in web client (Rust, 35.9k stars)
- [just](https://www.trmn.sh/tools/just.md): Command runner that saves and runs project-specific commands from a justfile with make-inspired syntax (Rust, 36.5k stars)

## Guides

- [Benchmark shell commands with hyperfine](https://www.trmn.sh/guides/benchmark-commands-hyperfine): Time shell commands with hyperfine: warmup runs, cache-clearing with --prepare, side-by-side comparisons, parameter scans and Markdown or JSON export.
- [Best Command-Line Benchmarking Tools](https://www.trmn.sh/best/benchmarking-tools): Compare hyperfine, wrk, hey and dnspyre for timing shell commands, HTTP endpoints and DNS servers from the command line.

---

Canonical: https://www.trmn.sh/tools/hyperfine
