hyperfine --env sets variables without an intermediate shell
Introduced 2026-10-07 · score 0.96
HOW TO USE IT
When benchmarking a repository command across thread counts, use `-P` to vary the `threads` parameter and `--env` to set `OMP_NUM_THREADS` for each value. The benchmark command runs without an intermediate shell by default.
hyperfine -P threads 1 8 --env 'OMP_NUM_THREADS={threads}' '<repository-command>'WHY THIS HELPS
Benchmark a repository command under different thread counts.
REQUIREMENTS AND LIMITATIONS
- Version: v2.0.0
- -P / --parameter-scan <name> <min> <max> (required): Varies one numeric parameter across the given range; `{name}` is replaced in the benchmark command and `--env` values.
- --env <assignments> (required): Sets environment variables for benchmark commands and setup, prepare, conclude, and cleanup commands. Assignments are space-separated; quoting is supported, but shell expansion is not.
- <repository-command> (required): The executable and its arguments to benchmark; commands run directly by default, without an intermediate shell.
FIRST-PARTY EVIDENCE
- https://github.com/sharkdp/hyperfine/releases/tag/v2.0.0
- https://github.com/sharkdp/hyperfine/blob/v2.0.0/README.md
Check the installed version and the source before using it. Entry JSON