Skip to content
Myr

README.md

This file

Path

README.md

96 lines · 3.0 KiB · Markdown

Last changed by

added void linux install to readmeWilson Birneybefore adoption8fdd6b5

History of this file

Take it

Add READMEDavid Peterbefore adoptionf8cbb33

line 1why, one step back
1# hyperfine

Add badgesDavid Peterbefore adoption0a77b43

lines 2–3why, one step back
2[![Build Status](https://travis-ci.org/sharkdp/hyperfine.svg?branch=master)](https://travis-ci.org/sharkdp/hyperfine)
3[![Version info](https://img.shields.io/crates/v/hyperfine.svg)](https://crates.io/crates/hyperfine)

Add READMEDavid Peterbefore adoptionf8cbb33

line 4why, one step back
4

Update README.mdDavid Peterbefore adoption1fe3c66

line 5why, one step back
5A command-line benchmarking tool (*inspired by [bench](https://github.com/Gabriel439/bench)*).

Add READMEDavid Peterbefore adoptionf8cbb33

line 6why, one step back
6

Rename --setup to --preparesharkdpbefore adoptiona656fbe

lines 7–8why, one step back
7**Demo**: Benchmarking [`fd`](https://github.com/sharkdp/fd) and
8[`find`](https://www.gnu.org/software/findutils/):

Add READMEDavid Peterbefore adoptionf8cbb33

line 9why, one step back
9

Update READMEDavid Peterbefore adoptioncaff4e1

lines 10–11why, one step back
10![hyperfine](https://i.imgur.com/5OqrGWe.gif)
11

Add READMEDavid Peterbefore adoptionf8cbb33

lines 12–13why, one step back
12## Features
13

Add Ubuntu install instructionsDavid Peterbefore adoptiona08581e

lines 14–18why, one step back
14* Statistical analysis across multiple runs.
15* Support for arbitrary shell commands.16* Constant feedback about the benchmark progress and current estimates.17* Warmup runs can be executed before the actual benchmark.18* Cache-clearing commands can be set up before each timing run.

TypoDavid Peterbefore adoptiona526f4c

line 19why, one step back
19* Statistical outlier detection.

Add Usage sectionDavid Peterbefore adoptiond5e02ff

lines 20–24why, one step back
20
21## Usage2223### Basic benchmark24

Rename --setup to --preparesharkdpbefore adoptiona656fbe

lines 25–26why, one step back
25To run a benchmark, you can simply call `hyperfine <command>...`. The argument(s) can be any
26shell command. For example:

Add Usage sectionDavid Peterbefore adoptiond5e02ff

line 27why, one step back
27``` bash

Remove prompt charactersDavid Peterbefore adoptioncda5816

line 28why, one step back
28hyperfine 'sleep 0.3'

Add Usage sectionDavid Peterbefore adoptiond5e02ff

lines 29–30why, one step back
29```
30

Rename --setup to --preparesharkdpbefore adoptiona656fbe

lines 31–33why, one step back
31Hyperfine will automatically determine the number of runs to perform for each command. By default,
32it will perform *at least* 10 benchmarking runs. To change this, you can use the `-m`/`--min-runs`33option:

Add Usage sectionDavid Peterbefore adoptiond5e02ff

line 34why, one step back
34``` bash

Remove prompt charactersDavid Peterbefore adoptioncda5816

line 35why, one step back
35hyperfine --min-runs 5 'sleep 0.2' 'sleep 3.2'

Add Usage sectionDavid Peterbefore adoptiond5e02ff

lines 36–39why, one step back
36```
3738### I/O-heavy programs39

Rename --setup to --preparesharkdpbefore adoptiona656fbe

line 40why, one step back
40If the program execution time is limited by disk I/O, the benchmarking results can be heavily

Another typoDavid Peterbefore adoption1068db5

line 41why, one step back
41influenced by disk caches and whether they are cold or warm.

Add Usage sectionDavid Peterbefore adoptiond5e02ff

line 42why, one step back
42

Rename --setup to --preparesharkdpbefore adoptiona656fbe

lines 43–44why, one step back
43If you want to run the benchmark on a warm cache, you can use the `-w`/`--warmup` option to perform
44a certain number of program executions before the actual benchmark:

Add Usage sectionDavid Peterbefore adoptiond5e02ff

line 45why, one step back
45``` bash

Remove prompt charactersDavid Peterbefore adoptioncda5816

line 46why, one step back
46hyperfine --warmup 3 'grep -R TODO *'

Add Usage sectionDavid Peterbefore adoptiond5e02ff

lines 47–48why, one step back
47```
48

Rename --setup to --preparesharkdpbefore adoptiona656fbe

lines 49–51why, one step back
49Conversely, if you want to run the benchmark for a cold cache, you can use the `-p`/`--prepare`
50option to run a special command before *each* timing run. For example, to clear harddisk caches51on Linux, you can run

Add Usage sectionDavid Peterbefore adoptiond5e02ff

lines 52–54why, one step back
52``` bash
53sync; echo 3 | sudo tee /proc/sys/vm/drop_caches54```

Recommend use of `sudo -v` over `sudo echo`Anthony Sombefore adoptione4e9377

line 55why, one step back
55To use this specific command with Hyperfine, call `sudo -v` to temporarily gain sudo permissions

Rename --setup to --preparesharkdpbefore adoptiona656fbe

line 56why, one step back
56and then call:

Add Usage sectionDavid Peterbefore adoptiond5e02ff

line 57why, one step back
57``` bash

Rename --setup to --preparesharkdpbefore adoptiona656fbe

line 58why, one step back
58hyperfine --prepare 'sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' 'grep -R TODO *'

Add Usage sectionDavid Peterbefore adoptiond5e02ff

line 59why, one step back
59```

Update READMEsharkdpbefore adoptione167b41

lines 60–62why, one step back
60
61## Installation62

Update README.mdDavid Peterbefore adoption1fe3c66

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

Update READMEsharkdpbefore adoptione167b41

lines 64–66why, one step back
64```
65cargo install hyperfine66```

Add READMEDavid Peterbefore adoptionf8cbb33

line 67why, one step back
67

Add Arch Linux instructionsDavid Peterbefore adoptionb0bab45

lines 68–73why, one step back
68### Arch Linux
6970On Arch Linux, hyperfine can be installed [from the AUR](https://aur.archlinux.org/packages/hyperfine):71```72yaourt -S hyperfine73```

Add Ubuntu install instructionsDavid Peterbefore adoptiona08581e

lines 74–79why, one step back
74
75### Ubuntu7677Download the appropriate `.deb` package from the [Release page](https://github.com/sharkdp/hyperfine/releases)78and install it via `dpkg`:79```

Updates for 0.4.0sharkdpbefore adoption89e6d37

lines 80–81why, one step back
80wget https://github.com/sharkdp/hyperfine/releases/download/v0.4.0/hyperfine_0.4.0_amd64.deb
81sudo dpkg -i hyperfine_0.4.0_amd64.deb

Add Ubuntu install instructionsDavid Peterbefore adoptiona08581e

lines 82–83why, one step back
82```
83

added void linux install to readmeWilson Birneybefore adoption8fdd6b5

lines 84–90why, one step back
84### Void Linux
8586Hyperfine can be installed via xbps8788```89xbps-install -S hyperfine90```

Add Arch Linux instructionsDavid Peterbefore adoptionb0bab45

line 91why, one step back
91

Add READMEDavid Peterbefore adoptionf8cbb33

lines 92–96why, one step back
92## Origin of the name
9394The name *hyperfine* was chosen in reference to the hyperfine levels of caesium 133 which play a crucial role in the95[definition of our base unit of time](https://en.wikipedia.org/wiki/Second#Based_on_caesium_microwave_atomic_clock)96— the second.