hyperfine.1
This file
Path
doc/hyperfine.1
371 lines · 10.5 KiB
Last changed by
Multiple output policiesDavid Peterbefore adoption99d24b7
History of this fileTake 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 back1.TH HYPERFINE 12.SH NAME3hyperfine \- command\-line benchmarking tool4.SH SYNOPSIS5.B hyperfineUpdate man pageDavid Peterbefore adoption0ce6578
lines 6–18why, one step back6.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 back19.RB [ \-\-conclude20.IR CMD ]Update man pageDavid Peterbefore adoption0ce6578
lines 21–56why, one step back21.RB [ \-\-cleanup22.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 back57.SH DESCRIPTION58A 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.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 86why, one step back86\fB\-w\fR, \fB\-\-warmup\fR \fINUM\fPBump version to 1.15David Peterbefore adoption790e1bf
line 87why, one step back87.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 88–89why, one step back88Perform \fINUM\fP warmup runs before the actual benchmark. This can be used89to fill (disk) caches for I/O\-heavy programs.Bump version to 1.15David Peterbefore adoption790e1bf
line 90why, one step back90.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 91why, one step back91\fB\-m\fR, \fB\-\-min\-runs\fR \fINUM\fPBump version to 1.15David Peterbefore adoption790e1bf
line 92why, one step back92.IPUpdate man pageDavid Peterbefore adoption0ce6578
line 93why, one step back93Perform at least \fINUM\fP runs for each command. Default: 10.Bump version to 1.15David Peterbefore adoption790e1bf
line 94why, one step back94.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 95why, one step back95\fB\-M\fR, \fB\-\-max\-runs\fR \fINUM\fPBump version to 1.15David Peterbefore adoption790e1bf
line 96why, one step back96.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 97–98why, one step back97Perform at most \fINUM\fP runs for each command. By default, there is no98limit.Bump version to 1.15David Peterbefore adoption790e1bf
line 99why, one step back99.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 100why, one step back100\fB\-r\fR, \fB\-\-runs\fR \fINUM\fPBump version to 1.15David Peterbefore adoption790e1bf
line 101why, one step back101.IPUpdate man pageDavid Peterbefore adoption0ce6578
line 102why, one step back102Perform 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 back103\fBhyperfine\fR automatically determines the number of runs.104.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 105why, one step back105\fB\-s\fR, \fB\-\-setup\fR \fICMD...\fPBump version to 1.15David Peterbefore adoption790e1bf
line 106why, one step back106.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 107–110why, one step back107Execute \fICMD\fP once before each set of timing runs. This is useful108for 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 back111.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 112why, one step back112\fB\-p\fR, \fB\-\-prepare\fR \fICMD...\fPBump version to 1.15David Peterbefore adoption790e1bf
line 113why, one step back113.IPUpdate man pageDavid Peterbefore adoption0ce6578
line 114why, one step back114Execute \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 back115for 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.HPUpdate docs to reflect addition of --concludeJack O'Connorbefore adoption942719b
lines 120–126why, one step back120.IP121Execute \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.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 127why, one step back127\fB\-c\fR, \fB\-\-cleanup\fR \fICMD...\fPBump version to 1.15David Peterbefore adoption790e1bf
line 128why, one step back128.IPUpdate man pageDavid Peterbefore adoption0ce6578
line 129why, one step back129Execute \fICMD\fP after the completion of all benchmarking runs for each individualBump version to 1.15David Peterbefore adoption790e1bf
line 130why, one step back130command to be benchmarked. This is useful if the commands to be benchmarkedUpdate docs to reflect addition of --concludeJack O'Connorbefore adoption942719b
lines 131–133why, one step back131produce artifacts that need to be cleaned up. It only runs once a series of132benchmark runs, as opposed to \fB\-\-conclude\fR option which runs after133ever run.Bump version to 1.15David Peterbefore adoption790e1bf
line 134why, one step back134.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 135why, one step back135\fB\-P\fR, \fB\-\-parameter\-scan\fR \fIVAR\fP \fIMIN\fP \fIMAX\fPBump version to 1.15David Peterbefore adoption790e1bf
line 136why, one step back136.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 137–138why, one step back137Perform benchmark runs for each value in the range \fIMIN..MAX\fP. Replaces the138string '{\fIVAR\fP}' in each command by the current parameter value.Bump version to 1.15David Peterbefore adoption790e1bf
lines 139–147why, one step back139.IP140.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 back148.IP149To 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 back156.REUpdate man pageDavid Peterbefore adoption0ce6578
lines 157–162why, one step back157.RE158.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 back163.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 164why, one step back164\fB\-D\fR, \fB\-\-parameter\-step\-size\fR \fIDELTA\fPBump version to 1.15David Peterbefore adoption790e1bf
lines 165–166why, one step back165.IP166This argument requires \fB\-\-parameter\-scan\fR to be specified as well. Traverse theUpdate man pageDavid Peterbefore adoption0ce6578
line 167why, one step back167range \fIMIN..MAX\fP in steps of \fIDELTA\fP.Bump version to 1.15David Peterbefore adoption790e1bf
lines 168–177why, one step back168.IP169.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.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 178why, one step back178\fB\-L\fR, \fB\-\-parameter\-list\fR \fIVAR\fP \fIVALUES\fPBump version to 1.15David Peterbefore adoption790e1bf
line 179why, one step back179.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 180–181why, one step back180Perform 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 back182.IP183.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 back191.IP192The option can be specified multiple times to run benchmarks for all193possible parameter combinations.Bump version to 1.15David Peterbefore adoption790e1bf
line 194why, one step back194.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 195why, one step back195\fB\-S\fR, \fB\-\-shell\fR \fISHELL\fPBump version to 1.15David Peterbefore adoption790e1bf
line 196why, one step back196.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 197–203why, one step back197Set the shell to use for executing benchmarked commands. This can be198the 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 back204.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 205why, one step back205\fB\-N\fRBump version to 1.15David Peterbefore adoption790e1bf
line 206why, one step back206.IPUpdate man pageDavid Peterbefore adoption0ce6578
line 207why, one step back207An alias for '\-\-shell=none'.Bump version to 1.15David Peterbefore adoption790e1bf
lines 208–212why, one step back208.HP209\fB\-i\fR, \fB\-\-ignore\-failure\fR210.IP211Ignore non\-zero exit codes of the benchmarked programs.212.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 213why, one step back213\fB\-\-style\fR \fITYPE\fPBump version to 1.15David Peterbefore adoption790e1bf
line 214why, one step back214.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 215–220why, one step back215Set output style \fITYPE\fP (default: auto). Set this to 'basic' to disable output216coloring 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 back221.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 222why, one step back222\fB\-\-sort\fR \fIMETHOD\fPBump version to 1.15David Peterbefore adoption790e1bf
line 223why, one step back223.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 224–234why, one step back224Specify the sort order of the speed comparison summary and the225exported 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.REBump version to 1.15David Peterbefore adoption790e1bf
line 235why, one step back235.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 236why, one step back236\fB\-u\fR, \fB\-\-time\-unit\fR \fIUNIT\fPBump version to 1.15David Peterbefore adoption790e1bf
line 237why, one step back237.IPAdd support for microseconds, closes #684David Peterbefore adoption4564977
line 238why, one step back238Set the time unit to be used. Possible values: microsecond, millisecond, second. IfUpdate man pageDavid Peterbefore adoption0ce6578
lines 239–250why, one step back239the 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 theBump version to 1.15David Peterbefore adoption790e1bf
line 251why, one step back251timing results for each individual run, use the JSON export format.Update man pageDavid Peterbefore adoption0ce6578
line 252why, one step back252The output time unit is always seconds.Bump version to 1.15David Peterbefore adoption790e1bf
line 253why, one step back253.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 254why, one step back254\fB\-\-export\-json\fR \fIFILE\fPBump version to 1.15David Peterbefore adoption790e1bf
lines 255–256why, one step back255.IP256Export the timing summary statistics and timings of individual runs as JSON toUpdate man pageDavid Peterbefore adoption0ce6578
line 257why, one step back257the given \fIFILE\fP. The output time unit is always seconds.Bump version to 1.15David Peterbefore adoption790e1bf
line 258why, one step back258.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 259why, one step back259\fB\-\-export\-markdown\fR \fIFILE\fPBump version to 1.15David Peterbefore adoption790e1bf
line 260why, one step back260.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 261–262why, one step back261Export 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 back263.HPUpdate man pageDavid Peterbefore adoption0ce6578
lines 264–268why, one step back264\fB\-\-export\-orgmode\fR \fIFILE\fP265.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.HPBump version to 1.15David Peterbefore adoption790e1bf
lines 269–274why, one step back269\fB\-\-show\-output\fR270.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.HPUpdate man pageDavid Peterbefore adoption0ce6578
line 275why, one step back275\fB\-\-output\fR \fIWHERE\fPBump version to 1.15David Peterbefore adoption790e1bf
line 276why, one step back276.IPUpdate man pageDavid Peterbefore adoption0ce6578
lines 277–292why, one step back277Control where the output of the benchmark is redirected. Note that278some 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.REMultiple output policiesDavid Peterbefore adoption99d24b7
lines 293–297why, one step back293.IP294This 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 back298.HPUpdate man pageDavid Peterbefore adoption0ce6578
lines 299–315why, one step back299\fB\-\-input\fR \fIWHERE\fP300.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.HPBump version to 1.15David Peterbefore adoption790e1bf
lines 316–317why, one step back316\fB\-h\fR, \fB\-\-help\fR317.IPUpdate man pageDavid Peterbefore adoption0ce6578
line 318why, one step back318Print helpBump version to 1.15David Peterbefore adoption790e1bf
lines 319–321why, one step back319.HP320\fB\-V\fR, \fB\-\-version\fR321.IPUpdate man pageDavid Peterbefore adoption0ce6578
line 322why, one step back322Print versionBump version to 1.15David Peterbefore adoption790e1bf
lines 323–353why, one step back323.SH EXAMPLES324.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.LPUpdate docs to reflect addition of --concludeJack O'Connorbefore adoption942719b
line 354why, one step back354Demonstrate 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 back355.RS356.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 back360 \fB\-\-conclude\fR 'echo conclude={n}' \\Bump version to 1.15David Peterbefore adoption790e1bf
lines 361–367why, one step back361 \fB\-\-cleanup\fR 'echo cleanup n={n}' \\362 'echo command n={n}'363.fi364.RE365.RE366.SH AUTHOR367.LPUpdate man pageDavid Peterbefore adoption0ce6578
line 368why, one step back368David Peter <mail@david-peter.de>Bump version to 1.15David Peterbefore adoption790e1bf
line 369why, one step back369.LPUpdate man pageDavid Peterbefore adoption0ce6578
line 370why, one step back370Source, bug tracker, and additional information can be found on GitHub:Bump version to 1.15David Peterbefore adoption790e1bf
line 371why, one step back371.I https://github.com/sharkdp/hyperfine