System Administration

Essential System Tools: hyperfine – command-line benchmarking tool

Last Updated on May 28, 2022

In Operation

Here’s a really short video of hyperfine in action. The video compares the ubiquitous find command with ripgrep (rg), a line-oriented search tool that recursively searches the current directory for a regular expression pattern.

The video highlights a few things. First, you get continuous feedback about the benchmark progress and current estimates. The tool measures ‘real’ time, as well as ‘user’ and ‘system’ time.

There’s no way to disable the standard output (with the progress bar) completely though, but you can always pipe the output to /dev/null if necessary. The software includes a statistical outlier detection which uses the median and the median average deviation (MAD) as robust estimators.

Also, if the shell command makes use of I/O to any great degree, you don’t want the results influenced by disk caching. So the shell commands in our video use hyperfine’s warm cache option. The –warmup 5 flag means the program is run 5 times before actually running the benchmark.

Hyperfine automatically determine the number of runs to perform for each command. By default, it makes a minimum of 10 benchmarking runs, but you can define the number of runs. There’s also the option to use cache-clearing commands before each timing run.

Next page: Page 3 – Other Features

Pages in this article:
Page 1 – Introduction / Installation
Page 2 – In Operation
Page 3 – Other Features
Page 4 – Summary

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
hib
hib
4 years ago

The video doesn’t load