explaingit

sharkdp/hyperfine

Analysis updated 2026-06-20

28,047RustAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

Hyperfine is a command-line tool that benchmarks how long shell commands take to run, comparing multiple commands with statistics and warmup runs to give trustworthy results.

Mindmap

mindmap
  root((hyperfine))
    What it does
      Times shell commands
      Multiple runs
      Statistical summary
    Key features
      Warmup runs
      Parameter sweep
      Shell overhead removal
    Output formats
      CSV
      JSON
      Markdown
    Use cases
      A vs B comparison
      Build optimization
      Performance regression
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Compare the speed of two different implementations of a script to find out which one is actually faster.

USE CASE 2

Benchmark a build command while sweeping the number of CPU threads to find the optimal parallelism setting.

USE CASE 3

Export timing results to JSON then generate histogram plots using the included Python scripts.

What is it built with?

Rust

How does it compare?

sharkdp/hyperfinechroma-core/chromaankitects/anki
Stars28,04727,83627,808
LanguageRustRustRust
Setup difficultyeasyeasymoderate
Complexity2/52/53/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Install via your OS package manager or cargo install hyperfine, no configuration needed.

Permissive open-source license, use freely for any purpose including commercial projects.

In plain English

Hyperfine is a command-line benchmarking tool. It exists to answer the simple question "how long does this command take to run, and how does it compare to that other command?", but to do it properly, with multiple runs, statistics, and corrections for things that would otherwise distort the result. You hand it any shell command and it runs that command many times, measures the duration of each run, and reports the average, minimum, maximum, and statistical spread. The basic usage is hyperfine followed by the command in quotes, for example hyperfine 'sleep 0.3'. By default it performs at least 10 runs and measures for at least three seconds, you can change that with --runs. If you pass several commands, hyperfine benchmarks each one and shows how much faster or slower they are relative to each other. Because disk caches can hugely affect timings, there is a --warmup option that runs the command a few times before the real measurements, and a --prepare option that runs a setup command before each timing run (the README's example clears the Linux disk cache between runs). A --parameter-scan option lets you sweep one variable across a range, for example varying the number of threads to a build, and --parameter-list does the same thing with a list of named values. There is also a --shell option, an -N flag to skip the intermediate shell for very fast commands, and a calibration step that subtracts the shell's startup time so it doesn't pollute the result. Results can be exported to CSV, JSON, Markdown, or AsciiDoc, and the repository includes Python scripts that turn the JSON into histograms and whisker plots for deeper analysis. Hyperfine is written in Rust and is cross-platform, and the README lists installation instructions for a long list of Linux distributions and package managers. You would use it any time you want a trustworthy "is A really faster than B?" measurement on the command line.

Copy-paste prompts

Prompt 1
Using hyperfine, write the command to benchmark 'grep -r foo .' versus 'rg foo .' with 20 runs and 3 warmup runs, then export results to JSON.
Prompt 2
Show me how to use hyperfine --parameter-scan to test a script with a thread count ranging from 1 to 8 and plot the results.
Prompt 3
Give me a hyperfine command that clears the Linux disk cache between each timing run using --prepare, so I can measure cold-cache read performance.
Prompt 4
How do I use hyperfine -N to benchmark a very fast command like 'ls' without the shell startup time distorting the result?

Frequently asked questions

What is hyperfine?

Hyperfine is a command-line tool that benchmarks how long shell commands take to run, comparing multiple commands with statistics and warmup runs to give trustworthy results.

What language is hyperfine written in?

Mainly Rust. The stack also includes Rust.

What license does hyperfine use?

Permissive open-source license, use freely for any purpose including commercial projects.

How hard is hyperfine to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is hyperfine for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub sharkdp on gitmyhub

Verify against the repo before relying on details.