Benchmarking
Overview of some CLI tools for benchmarking
Updated: 30 May 2025
Hyperfine
Hyperfine is a command line benchmarking tool that’s pretty straightforward. Using it looks like this:
1hyperfine [...flags] <...commands>It can be used to benchmark any number of commands
Basic Run
A simple benchmark of some commands can be seen below:
1hyperfine 'npm install' 'yarn install' 'pnpm install'Warming Up
Warmup runs can be added using --warmup <count as follows:
1hyperfine --warmup 3 'npm install' 'yarn install' 'pnpm install'Parameterized Run
The -L flag can be use to add a parameter, for example the above benchmark can also be done like so:
1hyperfine -L pkg npm,yarn,pnpm '{pkg} install'Flags
It also has some flags, the following of which I think are useful:
--warmup <count>the number of warmup iterations-i/--ignore-failureignores errors-s <shell>/--shell <shell>sets the shell to use for running commands-L <param> <comma separated values>/--parameter-listprovides a way to specify params--parameter-scan <param> <from> <to> -D <diff>makes it possible to provide a range for params