📈 GH Trending Explorer 🎲 Surprise me

← all repos

sharkdp / hyperfine

git clone https://github.com/sharkdp/hyperfine.git v2.0.0 · 15d ago

A command-line benchmarking tool

+5
stars, 24h · #6,385
+~28
stars, 7 days · #6,551
+~120
stars, 30 days · #6,161
29k
★ total · +0% this week
536
forks · 62 open issues

Star history (as recorded here)

2026-10-20 · 29,132 ★ 2026-10-23 · 29,144 ★
LanguageRust
LicenseApache-2.0
Created2018-01-13 (8y ago)
Last push11d ago
Watchers108
OwnerUser

GitHub topics

Links

README excerpt
# hyperfine
A command-line benchmarking tool.
*(hyperfine in action, benchmarking `mypy` and `ty`)*
## Features
* Statistical analysis across multiple runs.
* Support for various performance metrics and hardware counters.
* Support for arbitrary shell commands.
* Constant feedback about the benchmark progress and current estimates.
* Warmup runs can be executed before the actual benchmark.
* Cache-clearing commands can be set up before each benchmark run.
* Statistical outlier detection to detect interference from other programs and caching effects.
* Export results to various formats: CSV, JSON, Markdown, AsciiDoc.
* Parameterized benchmarks (e.g. vary the number of threads).
* Cross-platform
## Usage
### Basic benchmarks
To run a benchmark, you can simply call `hyperfine ...`. Each argument is an executable
and its arguments. Commands run directly by default; use `-S` for shell syntax such as
pipes, redirections, and wildcards. For example:
 [code] 
Hyperfine will automatically determine the number of runs to perform for each command. By default,
it will perform *at least* 10 benchmarking runs and estimate a run count targeting roughly
3 seconds, including shell overhead and preparation and conclusion commands. To set an exact
number of runs, you can use the `-r`/`--runs` option:
 [code] 
If you want to compare different programs, you can pass multiple commands:
 [code] 
Commands run and appear in input order. The first command is the reference for all comparisons;
each subsequent result shows its change from that reference.
### Warmup runs and preparation commands
For programs that perform a lot of disk I/O, the benchmarking results can be heavily influenced
by disk caches and whether they are cold or warm.
If you want to run the benchmark on a warm cache, you can use the `-w`/`--warmup` option to
perform a certain number of program executions before the actual benchmark:
 [code] 
Conversely, if you want to run the benchmark for a cold cache, you can use the `-p`/`--prepare`
option to run a special command before *each* benchmark run. For example, to clear Linux filesystem caches,
you can run
 [code] 
To use this specific command with hyperfine, call `sudo -v` to temporarily gain sudo permissions
and then call:
 [code] 
### Parameterized benchmarks
If you want to run a series of benchmarks where a single parameter is varied (say, the number of
threads), you can use the `-P`/`--parameter-scan` option and call:
 [code] 
This also works with decimal numbers. The `-D`/`--parameter-step-size` option can be used
to control the step size:
 [code] 
This runs `sleep 0.3`, `sleep 0.5` and `sleep 0.7`.
For non-numeric parameters, you can also supply a list of values with the `-L`/`--parameter-list`
option:
 [code] 
A common use case is comparing the same command across multiple Git branches. Use `--setup`
to switch branches once before each set of benchmark runs, so the branch switch is not part of
the measured command:
 [code] 
If you need a unique valu