Handy for per-run output files; needs -S for ${...} expansion.
Shell
-N / --shell=none
Run without a shell (default)
-S
Run through the default shell
sh on Unix, cmd.exe on Windows.
--shell <name>
Use a specific shell, e.g. bash or zsh
--shell=bash <function>
Benchmark an exported bash function
Export it first with export -f.
Output and export
--export-json <file>
Save stats and every sample as JSON
--export-markdown <file>
Save a Markdown table
--export-csv <file>
Save one CSV row per command
--export-asciidoc <file>
Save an AsciiDoc table
--export-orgmode <file>
Save an org-mode table
--style <type>
auto, basic, full, nocolor, color or none
Use basic or none in scripts and CI logs.
--metrics <list>
Choose metrics, e.g. time_wall_clock:ms
Presets: default, time, all. Hardware counters need no shell.
--metrics memory_peak_resident:MiB
Report peak memory in MiB
-h / --help
Show help
-V / --version
Show version
Recipes
Cold versus warm cache
# warm: ignore the first slow runshyperfine -S --warmup 3 'grep -R TODO .'# cold: drop the cache before every runsudo -vhyperfine -S --prepare 'sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' 'grep -R TODO .'