hyperfine.1
This file
Path
doc/hyperfine.1
212 lines · 5.9 KiB
Last changed by
Address code review:Cade Ekblad-Frankbefore adoptione595be7
History of this fileTake it
1.TH HYPERFINE 12.SH NAME3hyperfine \- command\-line benchmarking tool4.SH SYNOPSIS5.B hyperfine6.RB [ \-ihV ]7.RB [ \-w8.IR warmupruns ]9.RB [ \-r10.IR runs ]11.RB [ \-p12.IR cmd... ]13.RB [ \-c14.IR cmd ]15.RB [ \-s16.IR style ]17.RI [ cmd... ]18.SH DESCRIPTION19A command\-line benchmarking tool which includes:20.LP21.RS22* Statistical analysis across multiple runs23.RE24.RS25* Support for arbitrary shell commands26.RE27.RS28* Constant feedback about the benchmark progress and current estimates29.RE30.RS31* Warmup runs can be executed before the actual benchmark32.RE33.RS34* Cache-clearing commands can be set up before each timing run35.RE36.RS37* Statistical outlier detection to detect interference from other programs and caching effects38.RE39.RS40* Export results to various formats: CSV, JSON, Markdown, AsciiDoc41.RE42.RS43* Parameterized benchmarks (e.g. vary the number of threads)44.RE45.SH OPTIONS46.HP47\fB\-w\fR, \fB\-\-warmup\fR \fIwarmupruns\fP48.IP49Perform \fIwarmupruns\fP (number) before the actual benchmark. This can be used to fill50(disk) caches for I/O\-heavy programs.51.HP52\fB\-m\fR, \fB\-\-min\-runs\fR \fIminruns\fP53.IP54Perform at least \fIminruns\fP (number) runs for each command. Default: 10.55.HP56\fB\-M\fR, \fB\-\-max\-runs\fR \fImaxruns\fP57.IP58Perform at most \fImaxruns\fP (number) runs for each command. Default: no limit.59.HP60\fB\-r\fR, \fB\-\-runs\fR \fIruns\fP61.IP62Perform exactly \fIruns\fP (number) runs for each command. If this option is not specified,63\fBhyperfine\fR automatically determines the number of runs.64.HP65\fB\-p\fR, \fB\-\-prepare\fR \fIcmd...\fP66.IP67Execute \fIcmd\fP before each timing run. This is useful for clearing disk caches,68for example.69The \fB\-\-prepare\fR option can be specified once for all commands or multiple times,70once for each command. In the latter case, each preparation command will be71run prior to the corresponding benchmark command.72.HP73\fB\-c\fR, \fB\-\-cleanup\fR \fIcmd\fP74.IP75Execute \fIcmd\fP after the completion of all benchmarking runs for each individual76command to be benchmarked. This is useful if the commands to be benchmarked77produce artifacts that need to be cleaned up.78.HP79\fB\-P\fR, \fB\-\-parameter\-scan\fR \fIvar\fP \fImin\fP \fImax\fP80.IP81Perform benchmark runs for each value in the range \fImin..max\fP. Replaces the82string '{\fIvar\fP}' in each command by the current parameter value.83.IP84.RS85Example:86.RS87\fBhyperfine\fR \fB\-P\fR threads 1 8 'make \-j {threads}'88.RE89.RE90.IP91This performs benchmarks for 'make \-j 1', 'make \-j 2', ..., 'make \-j 8'.92.RE93.HP94\fB\-D\fR, \fB\-\-parameter\-step\-size\fR \fIdelta\fP95.IP96This argument requires \fB\-\-parameter\-scan\fR to be specified as well. Traverse the97range \fImin..max\fP in steps of \fIdelta\fP.98.IP99.RS100Example:101.RS102\fBhyperfine\fR \fB\-P\fR delay 0.3 0.7 \fB\-D\fR 0.2 'sleep {delay}'103.RE104.RE105.IP106This performs benchmarks for 'sleep 0.3', 'sleep 0.5' and 'sleep 0.7'.107.HP108\fB\-L\fR, \fB\-\-parameter\-list\fR \fIvar\fP \fIvalues\fP109.IP110Perform benchmark runs for each value in the comma\-seperated list of \fIvalues\fP.111Replaces the string '{\fIvar\fP}' in each command by the current parameter value.112.IP113.RS114Example:115.RS116\fBhyperfine\fR \fB\-L\fR compiler gcc,clang '{compiler} \-O2 main.cpp'117.RE118.RE119.IP120This performs benchmarks for 'gcc \-O2 main.cpp' and 'clang \-O2 main.cpp'.121.HP122\fB\-s\fR, \fB\-\-style\fR \fItype\fP123.IP124Set output style \fItype\fP (default: auto). Set this to 'basic' to disable output125coloring and interactive elements. Set it to 'full' to enable all effects even126if no interactive terminal was detected. Set this to 'nocolor' to keep the127interactive output without any colors. Set this to 'color' to keep the colors128without any interactive output. Set this to 'none' to disable all the output129of the tool.130.HP131\fB\-S\fR, \fB\-\-shell\fR \fIshell\fP132.IP133Set the \fIshell\fP to use for executing benchmarked commands.134.HP135\fB\-i\fR, \fB\-\-ignore\-failure\fR136.IP137Ignore non\-zero exit codes of the benchmarked programs.138.HP139\fB\-u\fR, \fB\-\-time\-unit\fR \fIunit\fP140.IP141Set the time \fIunit\fP to be used. Default: second. Possible values: millisecond, second.142.HP143\fB\-\-export\-asciidoc\fR \fIfile\fP 144.IP145Export the timing summary statistics as an Asciidoc table to the given \fIfile\fP.146.HP147\fB\-\-export\-csv\fR \fIfile\fP148.IP149Export the timing summary statistics as CSV to the given \fIfile\fP. If you need the150timing results for each individual run, use the JSON export format.151.HP152\fB\-\-export\-json\fR \fIfile\fP153.IP154Export the timing summary statistics and timings of individual runs as JSON to155the given \fIfile\fP.156.HP157\fB\-\-export\-markdown\fR \fIfile\fP158.IP159Export the timing summary statistics as a Markdown table to the given \fIfile\fP.160.HP161\fB\-\-show\-output\fR162.IP163Print the stdout and stderr of the benchmark instead of suppressing it. This164will increase the time it takes for benchmarks to run, so it should only be165used for debugging purposes or when trying to benchmark output speed.166.HP167\fB\-h\fR, \fB\-\-help\fR168.IP169Print help message.170.HP171\fB\-V\fR, \fB\-\-version\fR172.IP173Show version information.174.SH EXAMPLES175.LP176Basic benchmark of 'find . -name todo.txt':177.RS178.nf179\fBhyperfine\fR 'find . -name todo.txt'180.fi181.RE182.LP183Perform benchmarks for 'sleep 0.2' and 'sleep 3.2' with a minimum 5 runs each:184.RS185.nf186\fBhyperfine\fR \fB\-\-min\-runs\fR 5 'sleep 0.2' 'sleep 3.2'187.fi188.RE189.LP190Perform a benchmark of 'grep' with a warm disk cache by executing 3 runs up front that are not part191of the measurement: 192.RS193.nf194\fBhyperfine\fR \fB\-\-warmup\fR 3 'grep -R TODO *'195.fi196.RE197.LP198Export the results of a parameter scan benchmark to a markdown table: 199.RS200.nf201\fBhyperfine\fR \fB\-\-export\-markdown\fR output.md \fB\-\-parameter-scan\fR time 1 5 'sleep {time}'202.fi203.RE204.SH AUTHOR205.LP206David Peter (sharkdp)207.LP208Source, bug tracker, and additional information can be found on Github at:209.\ We should use the URL macro here but it isn't supported on all platforms210.\ .UR https://github.com/sharkdp/hyperfine211.\ .UE212.I https://github.com/sharkdp/hyperfine