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 fileTake 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 back1# hyperfine2[](https://travis-ci.org/sharkdp/hyperfine)Add Appveyor badgeDavid Peterbefore adoption0c987c1
line 3why, one step back3[](https://ci.appveyor.com/project/sharkdp/hyperfine)No hybrid between basic and fullsharkdpbefore adoptioneb92bd4
line 4why, one step back4[](https://crates.io/crates/hyperfine)Update README.mdDavid Peterbefore adoptionf1d4443
line 5why, one step back5[中文](https://github.com/chinanf-boy/hyperfine-zh)Docs: add chinese readme linkyobravebefore adoption4c814f6
line 6why, one step back6Add alternative tools sectionDavid Peterbefore adoption3395914
line 7why, one step back7A command-line benchmarking tool.No hybrid between basic and fullsharkdpbefore adoptioneb92bd4
lines 8–20why, one step back89**Demo**: Benchmarking [`fd`](https://github.com/sharkdp/fd) and10[`find`](https://www.gnu.org/software/findutils/):11121314## 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 back21* 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 back24* Cross-platformNo hybrid between basic and fullsharkdpbefore adoptioneb92bd4
lines 25–64why, one step back2526## 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 back6566### 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:79Update READMEDavid Peterbefore adoption52cbac4
lines 80–84why, one step back80| 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 back85Add link to "scripts" folderDavid Peterbefore adoptiond83d9ff
lines 86–88why, one step back86The JSON output is useful if you want to analyze the benchmark results in more detail. See the87[`scripts/`](https://github.com/sharkdp/hyperfine/tree/master/scripts) folder for some examples.88No hybrid between basic and fullsharkdpbefore adoptioneb92bd4
lines 89–90why, one step back89## Installation90Update install instructionsDavid Peterbefore adoption6063b40
lines 91–94why, one step back91### On Ubuntu9293Download 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 back95```Bump versionsharkdpbefore adoption65ccd8a
lines 96–97why, one step back96wget https://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine_1.6.0_amd64.deb97sudo dpkg -i hyperfine_1.6.0_amd64.debNo hybrid between basic and fullsharkdpbefore adoptioneb92bd4
lines 98–99why, one step back98```99Add Alpine Linux installation instructionsChloe Kudryavtsevbefore adoption0006e90
lines 100–106why, one step back100### On Alpine Linux101102On Alpine Linux, hyperfine can be installed [from the official repositories](https://pkgs.alpinelinux.org/packages?name=hyperfine):103```104apk add hyperfine105```106Update install instructionsDavid Peterbefore adoption6063b40
line 107why, one step back107### On Arch LinuxNo hybrid between basic and fullsharkdpbefore adoptioneb92bd4
lines 108–113why, one step back108109On Arch Linux, hyperfine can be installed [from the AUR](https://aur.archlinux.org/packages/hyperfine):110```111yaourt -S hyperfine112```113Update install instructionsDavid Peterbefore adoption6063b40
line 114why, one step back114### On Void LinuxNo hybrid between basic and fullsharkdpbefore adoptioneb92bd4
line 115why, one step back115Update install instructionsDavid Peterbefore adoption6063b40
lines 116–117why, one step back116Hyperfine can be installed via xbps117No hybrid between basic and fullsharkdpbefore adoptioneb92bd4
line 118why, one step back118```Update install instructionsDavid Peterbefore adoption6063b40
line 119why, one step back119xbps-install -S hyperfineUpdate READMEDavid Peterbefore adoption52cbac4
lines 120–126why, one step back120```121122### On macOS123124Hyperfine can be installed via [Homebrew](https://brew.sh):125```126brew install hyperfineNo hybrid between basic and fullsharkdpbefore adoptioneb92bd4
lines 127–128why, one step back127```128Small update to conda install instructionsDavid Peterbefore adoption06a2885
line 129why, one step back129### With condaAdd install instructions for installing via condaDaniel Bastbefore adoptionea41b55
line 130why, one step back130Add link to conda forgeDavid Peterbefore adoptionba28b40
line 131why, one step back131[](https://anaconda.org/conda-forge/hyperfine)Small update to conda install instructionsDavid Peterbefore adoption06a2885
lines 132–133why, one step back132133Hyperfine 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 back134```135conda install -c conda-forge hyperfine136```137Update install instructionsDavid Peterbefore adoption6063b40
line 138why, one step back138### With cargo (Linux, macOS, Windows)No hybrid between basic and fullsharkdpbefore adoptioneb92bd4
line 139why, one step back139Update install instructionsDavid Peterbefore adoption6063b40
line 140why, one step back140Hyperfine can be installed via [cargo](https://doc.rust-lang.org/cargo/):No hybrid between basic and fullsharkdpbefore adoptioneb92bd4
line 141why, one step back141```Update install instructionsDavid Peterbefore adoption6063b40
line 142why, one step back142cargo install hyperfineNo hybrid between basic and fullsharkdpbefore adoptioneb92bd4
line 143why, one step back143```Update install instructionsDavid Peterbefore adoption6063b40
line 144why, one step back144Bump minimum required Rust versionsharkdpbefore adoptione755da6
line 145why, one step back145Make sure that you use Rust 1.30 or higher.Bump minimum Rust version to 1.24sharkdpbefore adoption695f4f2
line 146why, one step back146Windows releasesharkdpbefore adoptioncc7ddc9
line 147why, one step back147### From binaries (Linux, macOS, Windows)Update install instructionsDavid Peterbefore adoption6063b40
lines 148–149why, one step back148149Download the corresponding archive from the [Release page](https://github.com/sharkdp/hyperfine/releases).Add alternative tools sectionDavid Peterbefore adoption3395914
lines 150–153why, one step back150151## Alternative tools152153 Hyperfine is inspired by [bench](https://github.com/Gabriel439/bench).No hybrid between basic and fullsharkdpbefore adoptioneb92bd4
lines 154–157why, one step back154155## Origin of the name156157The name *hyperfine* was chosen in reference to the hyperfine levels of caesium 133 which play a crucial role in theFixed broken hyperlink anchorSamuel Marksbefore adoptionfe041df
line 158why, one step back158[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 back159— the second.