Skip to content
Myr

hyperfine.1

This file

Path

doc/hyperfine.1

371 lines · 10.5 KiB

Last changed by

Multiple output policiesDavid Peterbefore adoption99d24b7

History of this file

Take it

The walk stopped after 200 commits: lines older than 790e1bf point at it.

Bump version to 1.15David Peterbefore adoption790e1bf

lines 1–5why, one step back
1.TH HYPERFINE 1
2.SH NAME3hyperfine \- command\-line benchmarking tool4.SH SYNOPSIS5.B hyperfine

Update man pageDavid Peterbefore adoption0ce6578

lines 6–18why, one step back
6.RB [ \-ihVN ]
7.RB [ \-\-warmup8.IR NUM ]9.RB [ \-\-min\-runs10.IR NUM ]11.RB [ \-\-max\-runs12.IR NUM ]13.RB [ \-\-runs14.IR NUM ]15.RB [ \-\-setup16.IR CMD ]17.RB [ \-\-prepare18.IR CMD ]

Update docs to reflect addition of --concludeJack O'Connorbefore adoption942719b

lines 19–20why, one step back
19.RB [ \-\-conclude
20.IR CMD ]

Update man pageDavid Peterbefore adoption0ce6578

lines 21–56why, one step back
21.RB [ \-\-cleanup
22.IR CMD ]23.RB [ \-\-parameter\-scan24.IR VAR25.IR MIN26.IR MAX ]27.RB [ \-\-parameter\-step\-size28.IR DELTA ]29.RB [ \-\-parameter\-list30.IR VAR31.IR VALUES ]32.RB [ \-\-shell33.IR SHELL ]34.RB [ \-\-style35.IR TYPE ]36.RB [ \-\-sort37.IR METHOD ]38.RB [ \-\-time-unit39.IR UNIT ]40.RB [ \-\-export\-asciidoc41.IR FILE ]42.RB [ \-\-export\-csv43.IR FILE ]44.RB [ \-\-export\-json45.IR FILE ]46.RB [ \-\-export\-markdown47.IR FILE ]48.RB [ \-\-export\-orgmode49.IR FILE ]50.RB [ \-\-output51.IR WHERE ]52.RB [ \-\-input53.IR WHERE ]54.RB [ \-\-command\-name55.IR NAME ]56.RI [ COMMAND... ]

Bump version to 1.15David Peterbefore adoption790e1bf

lines 57–85why, one step back
57.SH DESCRIPTION
58A command\-line benchmarking tool which includes:59.LP60.RS61* Statistical analysis across multiple runs62.RE63.RS64* Support for arbitrary shell commands65.RE66.RS67* Constant feedback about the benchmark progress and current estimates68.RE69.RS70* Warmup runs can be executed before the actual benchmark71.RE72.RS73* Cache-clearing commands can be set up before each timing run74.RE75.RS76* Statistical outlier detection to detect interference from other programs and caching effects77.RE78.RS79* Export results to various formats: CSV, JSON, Markdown, AsciiDoc80.RE81.RS82* Parameterized benchmarks (e.g. vary the number of threads)83.RE84.SH OPTIONS85.HP

Update man pageDavid Peterbefore adoption0ce6578

line 86why, one step back
86\fB\-w\fR, \fB\-\-warmup\fR \fINUM\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 87why, one step back
87.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 88–89why, one step back
88Perform \fINUM\fP warmup runs before the actual benchmark. This can be used
89to fill (disk) caches for I/O\-heavy programs.

Bump version to 1.15David Peterbefore adoption790e1bf

line 90why, one step back
90.HP

Update man pageDavid Peterbefore adoption0ce6578

line 91why, one step back
91\fB\-m\fR, \fB\-\-min\-runs\fR \fINUM\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 92why, one step back
92.IP

Update man pageDavid Peterbefore adoption0ce6578

line 93why, one step back
93Perform at least \fINUM\fP runs for each command. Default: 10.

Bump version to 1.15David Peterbefore adoption790e1bf

line 94why, one step back
94.HP

Update man pageDavid Peterbefore adoption0ce6578

line 95why, one step back
95\fB\-M\fR, \fB\-\-max\-runs\fR \fINUM\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 96why, one step back
96.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 97–98why, one step back
97Perform at most \fINUM\fP runs for each command. By default, there is no
98limit.

Bump version to 1.15David Peterbefore adoption790e1bf

line 99why, one step back
99.HP

Update man pageDavid Peterbefore adoption0ce6578

line 100why, one step back
100\fB\-r\fR, \fB\-\-runs\fR \fINUM\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 101why, one step back
101.IP

Update man pageDavid Peterbefore adoption0ce6578

line 102why, one step back
102Perform exactly \fINUM\fP runs for each command. If this option is not specified,

Bump version to 1.15David Peterbefore adoption790e1bf

lines 103–104why, one step back
103\fBhyperfine\fR automatically determines the number of runs.
104.HP

Update man pageDavid Peterbefore adoption0ce6578

line 105why, one step back
105\fB\-s\fR, \fB\-\-setup\fR \fICMD...\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 106why, one step back
106.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 107–110why, one step back
107Execute \fICMD\fP once before each set of timing runs. This is useful
108for compiling your software or with the provided parameters, or to do any109other work that should happen once before a series of benchmark runs,110not every time as would happen with the \fB\-\-prepare\fR option.

Bump version to 1.15David Peterbefore adoption790e1bf

line 111why, one step back
111.HP

Update man pageDavid Peterbefore adoption0ce6578

line 112why, one step back
112\fB\-p\fR, \fB\-\-prepare\fR \fICMD...\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 113why, one step back
113.IP

Update man pageDavid Peterbefore adoption0ce6578

line 114why, one step back
114Execute \fICMD\fP before each timing run. This is useful for clearing disk caches,

Bump version to 1.15David Peterbefore adoption790e1bf

lines 115–119why, one step back
115for example.
116The \fB\-\-prepare\fR option can be specified once for all commands or multiple times,117once for each command. In the latter case, each preparation command will be118run prior to the corresponding benchmark command.119.HP

Update docs to reflect addition of --concludeJack O'Connorbefore adoption942719b

lines 120–126why, one step back
120.IP
121Execute \fICMD\fP after each timing run. This is useful for clearing disk caches,122for example.123The \fB\-\-conclude\fR option can be specified once for all commands or multiple times,124once for each command. In the latter case, each conclusion command will be125run after the corresponding benchmark command.126.HP

Update man pageDavid Peterbefore adoption0ce6578

line 127why, one step back
127\fB\-c\fR, \fB\-\-cleanup\fR \fICMD...\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 128why, one step back
128.IP

Update man pageDavid Peterbefore adoption0ce6578

line 129why, one step back
129Execute \fICMD\fP after the completion of all benchmarking runs for each individual

Bump version to 1.15David Peterbefore adoption790e1bf

line 130why, one step back
130command to be benchmarked. This is useful if the commands to be benchmarked

Update docs to reflect addition of --concludeJack O'Connorbefore adoption942719b

lines 131–133why, one step back
131produce artifacts that need to be cleaned up. It only runs once a series of
132benchmark runs, as opposed to \fB\-\-conclude\fR option which runs after133ever run.

Bump version to 1.15David Peterbefore adoption790e1bf

line 134why, one step back
134.HP

Update man pageDavid Peterbefore adoption0ce6578

line 135why, one step back
135\fB\-P\fR, \fB\-\-parameter\-scan\fR \fIVAR\fP \fIMIN\fP \fIMAX\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 136why, one step back
136.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 137–138why, one step back
137Perform benchmark runs for each value in the range \fIMIN..MAX\fP. Replaces the
138string '{\fIVAR\fP}' in each command by the current parameter value.

Bump version to 1.15David Peterbefore adoption790e1bf

lines 139–147why, one step back
139.IP
140.RS141Example:142.RS143\fBhyperfine\fR \fB\-P\fR threads 1 8 'make \-j {threads}'144.RE145.RE146.IP147This performs benchmarks for 'make \-j 1', 'make \-j 2', ..., 'make \-j 8'.

Update man pageDavid Peterbefore adoption0ce6578

lines 148–155why, one step back
148.IP
149To have the value increase following different patterns, use shell150arithmetics.151.IP152.RS153Example:154.RS155\fBhyperfine\fR \fB\-P\fR size 0 3 'sleep $((2**{size}))'

Bump version to 1.15David Peterbefore adoption790e1bf

line 156why, one step back
156.RE

Update man pageDavid Peterbefore adoption0ce6578

lines 157–162why, one step back
157.RE
158.IP159This performs benchmarks with power of 2 increases: 'sleep 1', 'sleep1602', 'sleep 4', ...161.IP162The exact syntax may vary depending on your shell and OS.

Bump version to 1.15David Peterbefore adoption790e1bf

line 163why, one step back
163.HP

Update man pageDavid Peterbefore adoption0ce6578

line 164why, one step back
164\fB\-D\fR, \fB\-\-parameter\-step\-size\fR \fIDELTA\fP

Bump version to 1.15David Peterbefore adoption790e1bf

lines 165–166why, one step back
165.IP
166This argument requires \fB\-\-parameter\-scan\fR to be specified as well. Traverse the

Update man pageDavid Peterbefore adoption0ce6578

line 167why, one step back
167range \fIMIN..MAX\fP in steps of \fIDELTA\fP.

Bump version to 1.15David Peterbefore adoption790e1bf

lines 168–177why, one step back
168.IP
169.RS170Example:171.RS172\fBhyperfine\fR \fB\-P\fR delay 0.3 0.7 \fB\-D\fR 0.2 'sleep {delay}'173.RE174.RE175.IP176This performs benchmarks for 'sleep 0.3', 'sleep 0.5' and 'sleep 0.7'.177.HP

Update man pageDavid Peterbefore adoption0ce6578

line 178why, one step back
178\fB\-L\fR, \fB\-\-parameter\-list\fR \fIVAR\fP \fIVALUES\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 179why, one step back
179.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 180–181why, one step back
180Perform benchmark runs for each value in the comma\-separated list of \fIVALUES\fP.
181Replaces the string '{\fIVAR\fP}' in each command by the current parameter value.

Bump version to 1.15David Peterbefore adoption790e1bf

lines 182–190why, one step back
182.IP
183.RS184Example:185.RS186\fBhyperfine\fR \fB\-L\fR compiler gcc,clang '{compiler} \-O2 main.cpp'187.RE188.RE189.IP190This performs benchmarks for 'gcc \-O2 main.cpp' and 'clang \-O2 main.cpp'.

Update man pageDavid Peterbefore adoption0ce6578

lines 191–193why, one step back
191.IP
192The option can be specified multiple times to run benchmarks for all193possible parameter combinations.

Bump version to 1.15David Peterbefore adoption790e1bf

line 194why, one step back
194.HP

Update man pageDavid Peterbefore adoption0ce6578

line 195why, one step back
195\fB\-S\fR, \fB\-\-shell\fR \fISHELL\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 196why, one step back
196.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 197–203why, one step back
197Set the shell to use for executing benchmarked commands. This can be
198the name or the path to the shell executable, or a full command line199like "bash \fB\-\-norc\fR". It can also be set to "default" to explicitly200select the default shell on this platform. Finally, this can also be201set to "none" to disable the shell. In this case, commands will be202executed directly. They can still have arguments, but more complex203things like "sleep 0.1; sleep 0.2" are not possible without a shell.

Bump version to 1.15David Peterbefore adoption790e1bf

line 204why, one step back
204.HP

Update man pageDavid Peterbefore adoption0ce6578

line 205why, one step back
205\fB\-N\fR

Bump version to 1.15David Peterbefore adoption790e1bf

line 206why, one step back
206.IP

Update man pageDavid Peterbefore adoption0ce6578

line 207why, one step back
207An alias for '\-\-shell=none'.

Bump version to 1.15David Peterbefore adoption790e1bf

lines 208–212why, one step back
208.HP
209\fB\-i\fR, \fB\-\-ignore\-failure\fR210.IP211Ignore non\-zero exit codes of the benchmarked programs.212.HP

Update man pageDavid Peterbefore adoption0ce6578

line 213why, one step back
213\fB\-\-style\fR \fITYPE\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 214why, one step back
214.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 215–220why, one step back
215Set output style \fITYPE\fP (default: auto). Set this to 'basic' to disable output
216coloring and interactive elements. Set it to 'full' to enable all effects even217if no interactive terminal was detected. Set this to 'nocolor' to keep the218interactive output without any colors. Set this to 'color' to keep the colors219without any interactive output. Set this to 'none' to disable all the output220of the tool.

Bump version to 1.15David Peterbefore adoption790e1bf

line 221why, one step back
221.HP

Update man pageDavid Peterbefore adoption0ce6578

line 222why, one step back
222\fB\-\-sort\fR \fIMETHOD\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 223why, one step back
223.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 224–234why, one step back
224Specify the sort order of the speed comparison summary and the
225exported tables for markup formats (Markdown, AsciiDoc, org\-mode):226.RS227.IP "auto (default)"228the speed comparison will be ordered by time and229the markup tables will be ordered by command (input order).230.IP "command"231order benchmarks in the way they were specified232.IP "mean\-time"233order benchmarks by mean runtime234.RE

Bump version to 1.15David Peterbefore adoption790e1bf

line 235why, one step back
235.HP

Update man pageDavid Peterbefore adoption0ce6578

line 236why, one step back
236\fB\-u\fR, \fB\-\-time\-unit\fR \fIUNIT\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 237why, one step back
237.IP

Add support for microseconds, closes #684David Peterbefore adoption4564977

line 238why, one step back
238Set the time unit to be used. Possible values: microsecond, millisecond, second. If

Update man pageDavid Peterbefore adoption0ce6578

lines 239–250why, one step back
239the option is not given, the time unit is determined automatically.
240This option affects the standard output as well as all export formats241except for CSV and JSON.242.HP243\fB\-\-export\-asciidoc\fR \fIFILE\fP 244.IP245Export the timing summary statistics as an AsciiDoc table to the given \fIFILE\fP.246The output time unit can be changed using the \fB\-\-time\-unit\fR option.247.HP248\fB\-\-export\-csv\fR \fIFILE\fP249.IP250Export the timing summary statistics as CSV to the given \fIFILE\fP. If you need the

Bump version to 1.15David Peterbefore adoption790e1bf

line 251why, one step back
251timing results for each individual run, use the JSON export format.

Update man pageDavid Peterbefore adoption0ce6578

line 252why, one step back
252The output time unit is always seconds.

Bump version to 1.15David Peterbefore adoption790e1bf

line 253why, one step back
253.HP

Update man pageDavid Peterbefore adoption0ce6578

line 254why, one step back
254\fB\-\-export\-json\fR \fIFILE\fP

Bump version to 1.15David Peterbefore adoption790e1bf

lines 255–256why, one step back
255.IP
256Export the timing summary statistics and timings of individual runs as JSON to

Update man pageDavid Peterbefore adoption0ce6578

line 257why, one step back
257the given \fIFILE\fP. The output time unit is always seconds.

Bump version to 1.15David Peterbefore adoption790e1bf

line 258why, one step back
258.HP

Update man pageDavid Peterbefore adoption0ce6578

line 259why, one step back
259\fB\-\-export\-markdown\fR \fIFILE\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 260why, one step back
260.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 261–262why, one step back
261Export the timing summary statistics as a Markdown table to the given \fIFILE\fP.
262The output time unit can be changed using the \fB\-\-time\-unit\fR option.

Bump version to 1.15David Peterbefore adoption790e1bf

line 263why, one step back
263.HP

Update man pageDavid Peterbefore adoption0ce6578

lines 264–268why, one step back
264\fB\-\-export\-orgmode\fR \fIFILE\fP
265.IP266Export the timing summary statistics as an Emacs org\-mode table to the267given \fIFILE\fP. The output time unit can be changed using the \fB\-\-time\-unit\fR option.268.HP

Bump version to 1.15David Peterbefore adoption790e1bf

lines 269–274why, one step back
269\fB\-\-show\-output\fR
270.IP271Print the stdout and stderr of the benchmark instead of suppressing it. This272will increase the time it takes for benchmarks to run, so it should only be273used for debugging purposes or when trying to benchmark output speed.274.HP

Update man pageDavid Peterbefore adoption0ce6578

line 275why, one step back
275\fB\-\-output\fR \fIWHERE\fP

Bump version to 1.15David Peterbefore adoption790e1bf

line 276why, one step back
276.IP

Update man pageDavid Peterbefore adoption0ce6578

lines 277–292why, one step back
277Control where the output of the benchmark is redirected. Note that
278some programs like 'grep' detect when standard output is \fI\,/dev/null\/\fP and279apply certain optimizations. To avoid that, consider using280\-\-output=pipe.281.IP282\fIWHERE\fP can be:283.RS284.IP null285Redirect output to \fI\,/dev/null\/\fP (the default).286.IP pipe287Feed the output through a pipe before discarding it.288.IP inherit289Don't redirect the output at all (same as \&'\-\-show\-output').290.IP "<FILE>"291Write the output to the given file.292.RE

Multiple output policiesDavid Peterbefore adoption99d24b7

lines 293–297why, one step back
293.IP
294This option can be specified once for all commands or multiple times,295once for each command. Note: If you want to log the output of each and296every iteration, you can use a shell redirection and the $HYPERFINE_ITERATION297environment variable: 'my-command > output-${HYPERFINE_ITERATION}.log'

Bump version to 1.15David Peterbefore adoption790e1bf

line 298why, one step back
298.HP

Update man pageDavid Peterbefore adoption0ce6578

lines 299–315why, one step back
299\fB\-\-input\fR \fIWHERE\fP
300.IP301Control where the input of the benchmark comes from.302.IP303\fIWHERE\fP can be:304.RS305.IP null306Read from \fI\,/dev/null\/\fP (the default).307.IP "<FILE>"308Read the input from the given file.309.RE310.HP311\fB\-n\fR, \fB\-\-command\-name\fR \fiNAME\fP312.IP313Give a meaningful \fiNAME\fP to a command. This can be specified multiple times314if several commands are benchmarked.315.HP

Bump version to 1.15David Peterbefore adoption790e1bf

lines 316–317why, one step back
316\fB\-h\fR, \fB\-\-help\fR
317.IP

Update man pageDavid Peterbefore adoption0ce6578

line 318why, one step back
318Print help

Bump version to 1.15David Peterbefore adoption790e1bf

lines 319–321why, one step back
319.HP
320\fB\-V\fR, \fB\-\-version\fR321.IP

Update man pageDavid Peterbefore adoption0ce6578

line 322why, one step back
322Print version

Bump version to 1.15David Peterbefore adoption790e1bf

lines 323–353why, one step back
323.SH EXAMPLES
324.LP325Basic benchmark of 'find . -name todo.txt':326.RS327.nf328\fBhyperfine\fR 'find . -name todo.txt'329.fi330.RE331.LP332Perform benchmarks for 'sleep 0.2' and 'sleep 3.2' with a minimum 5 runs each:333.RS334.nf335\fBhyperfine\fR \fB\-\-min\-runs\fR 5 'sleep 0.2' 'sleep 3.2'336.fi337.RE338.LP339Perform a benchmark of 'grep' with a warm disk cache by executing 3 runs up front that are not part340of the measurement: 341.RS342.nf343\fBhyperfine\fR \fB\-\-warmup\fR 3 'grep -R TODO *'344.fi345.RE346.LP347Export the results of a parameter scan benchmark to a markdown table: 348.RS349.nf350\fBhyperfine\fR \fB\-\-export\-markdown\fR output.md \fB\-\-parameter-scan\fR time 1 5 'sleep {time}'351.fi352.RE353.LP

Update docs to reflect addition of --concludeJack O'Connorbefore adoption942719b

line 354why, one step back
354Demonstrate when each of \fB\-\-setup\fR, \fB\-\-prepare\fR, \fB\-\-conclude\fR, \fIcmd\fP and \fB\-\-cleanup\fR will run:

Bump version to 1.15David Peterbefore adoption790e1bf

lines 355–359why, one step back
355.RS
356.nf357\fBhyperfine\fR \fB\-L\fR n 1,2 \fB\-r\fR 2 \fB\-\-show-output\fR \\358 \fB\-\-setup\fR 'echo setup n={n}' \\359 \fB\-\-prepare\fR 'echo prepare={n}' \\

Update docs to reflect addition of --concludeJack O'Connorbefore adoption942719b

line 360why, one step back
360 \fB\-\-conclude\fR 'echo conclude={n}' \\

Bump version to 1.15David Peterbefore adoption790e1bf

lines 361–367why, one step back
361 \fB\-\-cleanup\fR 'echo cleanup n={n}' \\
362 'echo command n={n}'363.fi364.RE365.RE366.SH AUTHOR367.LP

Update man pageDavid Peterbefore adoption0ce6578

line 368why, one step back
368David Peter <mail@david-peter.de>

Bump version to 1.15David Peterbefore adoption790e1bf

line 369why, one step back
369.LP

Update man pageDavid Peterbefore adoption0ce6578

line 370why, one step back
370Source, bug tracker, and additional information can be found on GitHub:

Bump version to 1.15David Peterbefore adoption790e1bf

line 371why, one step back
371.I https://github.com/sharkdp/hyperfine