Measure whether a code change made your program faster or slower with hard numbers.
Compare two tools or implementations to see which one performs better in your specific scenario.
Benchmark with realistic conditions by warming up caches or clearing them before each run.
Generate performance comparison tables for documentation or reports in CSV, JSON, or Markdown format.
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.
Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.