Skip to content
Myr

README.md

This file

Path

README.md

159 lines · 5.3 KiB · Markdown

Last changed by

Add Alpine Linux installation instructionsChloe Kudryavtsevbefore adoption0006e90

History of this file

Take it

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

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

lines 1–2why, one step back
1# hyperfine
2[![Build Status](https://travis-ci.org/sharkdp/hyperfine.svg?branch=master)](https://travis-ci.org/sharkdp/hyperfine)

Add Appveyor badgeDavid Peterbefore adoption0c987c1

line 3why, one step back
3[![Build status](https://ci.appveyor.com/api/projects/status/pdqq5frgkcj0smrs?svg=true)](https://ci.appveyor.com/project/sharkdp/hyperfine)

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

line 4why, one step back
4[![Version info](https://img.shields.io/crates/v/hyperfine.svg)](https://crates.io/crates/hyperfine)

Update README.mdDavid Peterbefore adoptionf1d4443

line 5why, one step back
5[中文](https://github.com/chinanf-boy/hyperfine-zh)

Docs: add chinese readme linkyobravebefore adoption4c814f6

line 6why, one step back
6

Add alternative tools sectionDavid Peterbefore adoption3395914

line 7why, one step back
7A command-line benchmarking tool.

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

lines 8–20why, one step back
8
9**Demo**: Benchmarking [`fd`](https://github.com/sharkdp/fd) and10[`find`](https://www.gnu.org/software/findutils/):1112![hyperfine](https://i.imgur.com/5OqrGWe.gif)1314## Features1516* Statistical analysis across multiple runs.17* Support for arbitrary shell commands.18* Constant feedback about the benchmark progress and current estimates.19* Warmup runs can be executed before the actual benchmark.20* Cache-clearing commands can be set up before each timing run.

Update READMEDavid Peterbefore adoption52cbac4

lines 21–23why, one step back
21* Statistical outlier detection to detect interference from other programs and caching effects.
22* Export results to various formats: CSV, JSON, Markdown, AsciiDoc.23* Parameterized benchmarks (e.g. vary the number of threads).

Update README.mdDavid Peterbefore adoptionfaff3e6

line 24why, one step back
24* Cross-platform

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

lines 25–64why, one step back
25
26## Usage2728### Basic benchmark2930To run a benchmark, you can simply call `hyperfine <command>...`. The argument(s) can be any31shell command. For example:32``` bash33hyperfine 'sleep 0.3'34```3536Hyperfine will automatically determine the number of runs to perform for each command. By default,37it will perform *at least* 10 benchmarking runs. To change this, you can use the `-m`/`--min-runs`38option:39``` bash40hyperfine --min-runs 5 'sleep 0.2' 'sleep 3.2'41```4243### I/O-heavy programs4445If the program execution time is limited by disk I/O, the benchmarking results can be heavily46influenced by disk caches and whether they are cold or warm.4748If you want to run the benchmark on a warm cache, you can use the `-w`/`--warmup` option to perform49a certain number of program executions before the actual benchmark:50``` bash51hyperfine --warmup 3 'grep -R TODO *'52```5354Conversely, if you want to run the benchmark for a cold cache, you can use the `-p`/`--prepare`55option to run a special command before *each* timing run. For example, to clear harddisk caches56on Linux, you can run57``` bash58sync; echo 3 | sudo tee /proc/sys/vm/drop_caches59```60To use this specific command with Hyperfine, call `sudo -v` to temporarily gain sudo permissions61and then call:62``` bash63hyperfine --prepare 'sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' 'grep -R TODO *'64```

Add section about param. benchmarks and exportsharkdpbefore adoptionfdc4c65

lines 65–79why, one step back
65
66### Parameterized benchmarks6768If you want to run a benchmark where only a single parameter is varied (say, the number of69threads), you can use the `-P`/`--parameter-scan` option and call:70``` bash71hyperfine --prepare 'make clean' --parameter-scan num_threads 1 12 'make -j {num_threads}'72```7374### Export results7576Hyperfine has multiple options for exporting benchmark results: CSV, JSON, Markdown (see `--help`77text for details). To export results to Markdown, for example, you can use the `--export-markdown`78option that will create tables like this:79

Update READMEDavid Peterbefore adoption52cbac4

lines 80–84why, one step back
80| Command | Mean [s] | Min [s] | Max [s] | Relative |
81|:---|---:|---:|---:|---:|82| `find . -iregex '.*[0-9]\.jpg$'` | 2.395 ± 0.033 | 2.355 | 2.470 | 7.7 |83| `find . -iname '*[0-9].jpg'` | 1.416 ± 0.029 | 1.389 | 1.494 | 4.6 |84| `fd -HI '.*[0-9]\.jpg$'` | 0.309 ± 0.005 | 0.305 | 0.320 | 1.0 |

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

line 85why, one step back
85

Add link to "scripts" folderDavid Peterbefore adoptiond83d9ff

lines 86–88why, one step back
86The JSON output is useful if you want to analyze the benchmark results in more detail. See the
87[`scripts/`](https://github.com/sharkdp/hyperfine/tree/master/scripts) folder for some examples.88

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

lines 89–90why, one step back
89## Installation
90

Update install instructionsDavid Peterbefore adoption6063b40

lines 91–94why, one step back
91### On Ubuntu
9293Download the appropriate `.deb` package from the [Release page](https://github.com/sharkdp/hyperfine/releases)94and install it via `dpkg`:

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

line 95why, one step back
95```

Bump versionsharkdpbefore adoption65ccd8a

lines 96–97why, one step back
96wget https://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine_1.6.0_amd64.deb
97sudo dpkg -i hyperfine_1.6.0_amd64.deb

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

lines 98–99why, one step back
98```
99

Add Alpine Linux installation instructionsChloe Kudryavtsevbefore adoption0006e90

lines 100–106why, one step back
100### On Alpine Linux
101102On Alpine Linux, hyperfine can be installed [from the official repositories](https://pkgs.alpinelinux.org/packages?name=hyperfine):103```104apk add hyperfine105```106

Update install instructionsDavid Peterbefore adoption6063b40

line 107why, one step back
107### On Arch Linux

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

lines 108–113why, one step back
108
109On Arch Linux, hyperfine can be installed [from the AUR](https://aur.archlinux.org/packages/hyperfine):110```111yaourt -S hyperfine112```113

Update install instructionsDavid Peterbefore adoption6063b40

line 114why, one step back
114### On Void Linux

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

line 115why, one step back
115

Update install instructionsDavid Peterbefore adoption6063b40

lines 116–117why, one step back
116Hyperfine can be installed via xbps
117

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

line 118why, one step back
118```

Update install instructionsDavid Peterbefore adoption6063b40

line 119why, one step back
119xbps-install -S hyperfine

Update READMEDavid Peterbefore adoption52cbac4

lines 120–126why, one step back
120```
121122### On macOS123124Hyperfine can be installed via [Homebrew](https://brew.sh):125```126brew install hyperfine

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

lines 127–128why, one step back
127```
128

Small update to conda install instructionsDavid Peterbefore adoption06a2885

line 129why, one step back
129### With conda

Add install instructions for installing via condaDaniel Bastbefore adoptionea41b55

line 130why, one step back
130

Add link to conda forgeDavid Peterbefore adoptionba28b40

line 131why, one step back
131[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/hyperfine.svg)](https://anaconda.org/conda-forge/hyperfine)

Small update to conda install instructionsDavid Peterbefore adoption06a2885

lines 132–133why, one step back
132
133Hyperfine can be installed via [`conda`](https://conda.io/en/latest/) from the [`conda-forge`](https://anaconda.org/conda-forge/hyperfine) channel:

Add install instructions for installing via condaDaniel Bastbefore adoptionea41b55

lines 134–137why, one step back
134```
135conda install -c conda-forge hyperfine136```137

Update install instructionsDavid Peterbefore adoption6063b40

line 138why, one step back
138### With cargo (Linux, macOS, Windows)

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

line 139why, one step back
139

Update install instructionsDavid Peterbefore adoption6063b40

line 140why, one step back
140Hyperfine can be installed via [cargo](https://doc.rust-lang.org/cargo/):

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

line 141why, one step back
141```

Update install instructionsDavid Peterbefore adoption6063b40

line 142why, one step back
142cargo install hyperfine

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

line 143why, one step back
143```

Update install instructionsDavid Peterbefore adoption6063b40

line 144why, one step back
144

Bump minimum required Rust versionsharkdpbefore adoptione755da6

line 145why, one step back
145Make sure that you use Rust 1.30 or higher.

Bump minimum Rust version to 1.24sharkdpbefore adoption695f4f2

line 146why, one step back
146

Windows releasesharkdpbefore adoptioncc7ddc9

line 147why, one step back
147### From binaries (Linux, macOS, Windows)

Update install instructionsDavid Peterbefore adoption6063b40

lines 148–149why, one step back
148
149Download the corresponding archive from the [Release page](https://github.com/sharkdp/hyperfine/releases).

Add alternative tools sectionDavid Peterbefore adoption3395914

lines 150–153why, one step back
150
151## Alternative tools152153 Hyperfine is inspired by [bench](https://github.com/Gabriel439/bench).

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

lines 154–157why, one step back
154
155## Origin of the name156157The name *hyperfine* was chosen in reference to the hyperfine levels of caesium 133 which play a crucial role in the

Fixed broken hyperlink anchorSamuel Marksbefore adoptionfe041df

line 158why, one step back
158[definition of our base unit of time](https://en.wikipedia.org/wiki/Second#History_of_definition)

No hybrid between basic and fullsharkdpbefore adoptioneb92bd4

line 159why, one step back
159— the second.