Forrest logo
back to the hyperfine tool

hyperfine:tldr:c0d1d

hyperfine: Run a command before each benchmark run (to clear caches, etc.).
$ hyperfine --prepare '${make clean}' '${make}'
try on your machine

The command hyperfine --prepare '${make clean}' '${make}' utilizes the hyperfine tool to measure and benchmark the execution time of two shell commands.

Here's how it works:

  • hyperfine is a benchmarking tool used to compare the runtime performance of different programs or commands.
  • The --prepare flag is used to specify shell commands that should be executed before each benchmark run. In this case, ${make clean} and ${make} are provided as the preparation commands.
  • ${make clean} is a shell command that likely executes the clean target of the make build system. It's often used to remove any built or generated files to ensure a clean state before building.
  • ${make} is a shell command that typically runs the default target in the make build system, which could involve compiling and building a software project.

Putting it all together, the hyperfine command will run benchmarks with a preparation step where it executes make clean to clean up any previous build artifacts, followed by make to build the project. It then measures the execution time of these commands, allowing you to compare their performance.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the hyperfine tool