benchmarks: added hyperfine

master
tiyn 1 year ago
parent 85c7f15d88
commit fdf05f68fa

@ -0,0 +1,8 @@
# Benchmark
A benchmark is the act of running a program or operation in order to assess its performance.
Benchmarks can use a range of criteria to compare programs with one another.
## Tools
- [Hyperfine](/wiki/linux/hyperfine.md) is a benchmarking tool for [Linux](/wiki/linux/linux.md).

@ -0,0 +1,28 @@
# Hyperfine
[Hyperfine](https://github.com/sharkdp/hyperfine) is a [benchmarking](/wiki/benchmark.md) tool.
## Usage
### Benchmark One or More Programs
To benchmark a program it is recommended to warm up the cache before.
This can be done as shown in the following command.
```sh
hyperfine --warmup 5 'sleep 0.3'
```
Unless specified otherwise at least 10 runs will be made to benchmark a program.
To change this the `--runs` flag can be used.
An example of it is given in the following command.
```sh
hyperfine --warmup 5 --runs 3 'sleep 0.3'
```
To compare two programs simply append the program to compare to as shown in the following command.
```sh
hyperfine --warmup 5 'sleep 0.3' 'sleep 0.4'
```
Loading…
Cancel
Save