---
next_cursor: eyJzY29yZSI6MCwic2VxIjoxOTgzLCJzaW5jZSI6bnVsbCwidG9vbCI6Imh5cGVyZmluZSIsInYiOjF9
has_more: false
next: https://sincecutoff.com/v1/changes.md?tool=hyperfine&score=0&cursor=eyJzY29yZSI6MCwic2VxIjoxOTgzLCJzaW5jZSI6bnVsbCwidG9vbCI6Imh5cGVyZmluZSIsInYiOjF9
items: 5
---
# sincecutoff.com changes: hyperfine

## hyperfine exposes iteration number to --prepare and --conclude (hyperfine, 2026-10-05)
Published 2026-10-19
- slug: hyperfine-exposes-iteration-number-to-prepare-and-conclude-0dc366a5d031
- score: 0.95

How to use it:

When setup or cleanup must vary by benchmark iteration, read `$HYPERFINE_ITERATION` in a `--prepare` or `--conclude` command; the variable is zero-based. [v1.21.0 release notes](https://github.com/sharkdp/hyperfine/releases/tag/v1.21.0) [README](https://github.com/sharkdp/hyperfine/blob/v1.21.0/README.md)

Examples:

```
hyperfine --prepare 'echo prepare-${HYPERFINE_ITERATION}' --conclude 'echo conclude-${HYPERFINE_ITERATION}' '<benchmark-command>'
```

- why_it_matters: Make benchmark setup or cleanup commands vary their behavior by iteration.
- sources: <https://github.com/sharkdp/hyperfine/releases/tag/v1.21.0>, <https://github.com/sharkdp/hyperfine/blob/v1.21.0/doc/hyperfine.1>
- gotchas: "Version: v1.21.0"; "--prepare <CMD...>: Runs CMD before each timing run; can be specified once for all commands or multiple times, once per benchmark command."; "--conclude <CMD...>: Runs CMD after each timing run; can be specified once for all commands or multiple times, once per benchmark command."; "$HYPERFINE_ITERATION: Zero-based iteration number exposed to the benchmarked command; v1.21.0 release notes state it is also exposed to --prepare and --conclude commands."; "Prerequisite: Use hyperfine v1.21.0 or later for the documented release-note behavior."

## hyperfine --reference selects a benchmark by exact displayed name in parameter scans (hyperfine, 2026-10-05)
Published 2026-10-19
- slug: hyperfine-reference-selects-a-benchmark-by-exact-displayed-name-in-parameter-sca-b91c6ed2bfc9
- score: 0.96

How to use it:

When scanning or listing parameterized benchmarks, pass `--reference` with the exact printed name of one benchmark in that invocation. Use `--command-name` to name a benchmark; `--reference-name` cannot be used with parameterized benchmarks.

Examples:

```
hyperfine --parameter-scan <VAR> <MIN> <MAX> --command-name '<benchmark name>' '<parameterized command using {VAR}>' --command-name '<reference name>' '<reference command>' --reference '<reference name>'
```

```
hyperfine --parameter-list <VAR> <comma-separated-values> --command-name '<benchmark name>' '<parameterized command using {VAR}>' --command-name '<reference name>' '<reference command>' --reference '<reference name>'
```

- why_it_matters: Use an existing benchmark as the reference while scanning or listing parameterized commands.
- before: Previously, `--reference` ran a separate reference command; with `--parameter-scan` or `--parameter-list`, it now selects an existing benchmark by its full displayed name.
- sources: <https://github.com/sharkdp/hyperfine/releases/tag/v1.21.0>, <https://github.com/sharkdp/hyperfine/blob/v1.21.0/doc/hyperfine.1>
- gotchas: "Version: v1.21.0"; "--parameter-scan <VAR> <MIN> <MAX>: Benchmark each value in MIN..MAX, substituting `{VAR}` in commands. Use for a parameter scan."; "--parameter-list <VAR> <VALUES>: Benchmark each comma-separated value, substituting `{VAR}` in commands. Use for a parameter list."; "--reference <CMD> (required): With a parameter scan or list, select an existing benchmark by its exact printed name; it must match exactly one benchmark."; "--command-name <NAME>: Give a command a meaningful name; can be specified multiple times for multiple commands. Use this instead of `--reference-name` with parameterized benchmarks."; "--reference-name <NAME>: Names a reference command and requires `--reference`; cannot be used with parameterized benchmarks. Use `--command-name` instead. These options are incompatible in this mode."; "The full displayed name must match exactly one benchmark."; "This behavior applies with `--parameter-scan` or `--parameter-list`."; "Use `--command-name` instead of `--reference-name` in this mode."

## hyperfine --env sets variables without an intermediate shell (hyperfine, 2026-10-07)
Published 2026-10-19
- slug: hyperfine-env-sets-variables-without-an-intermediate-shell-729eb753717b
- 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.

Examples:

```
hyperfine -P threads 1 8 --env 'OMP_NUM_THREADS={threads}' '<repository-command>'
```

- why_it_matters: Benchmark a repository command under different thread counts.
- sources: <https://github.com/sharkdp/hyperfine/releases/tag/v2.0.0>, <https://github.com/sharkdp/hyperfine/blob/v2.0.0/README.md>
- gotchas: "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."

## hyperfine executes benchmarks directly and runs setup and cleanup commands in a shell (hyperfine, 2026-10-07)
Published 2026-10-19
- slug: hyperfine-executes-benchmarks-directly-and-runs-setup-and-cleanup-commands-in-a-12e18fb2b73b
- score: 0.97

How to use it:

When benchmarking a repository command, Hyperfine runs the benchmark command directly by default. Add setup or cleanup hooks as needed; those hooks run in a shell even with `--shell=none`.

Examples:

```
hyperfine --setup '<setup command>' --prepare '<before each run>' --conclude '<after each run>' --cleanup '<cleanup command>' '<repository command>'
```

```
hyperfine -S --setup '<setup command>' --cleanup '<cleanup command>' '<repository command>'
```

```
hyperfine --shell <SHELL> --setup '<setup command>' --cleanup '<cleanup command>' '<repository command>'
```

- why_it_matters: Benchmark a repository command directly while retaining shell execution for setup and cleanup steps.
- before: Before v2.0.0, benchmarked commands used a platform default shell: `sh` on Unix and `cmd.exe` on Windows. Use `-S` / `--shell=default` to restore that behavior.
- sources: <https://github.com/sharkdp/hyperfine/releases/tag/v2.0.0>, <https://github.com/sharkdp/hyperfine/blob/v2.0.0/README.md>
- gotchas: "Version: v2.0.0"; "<repository command> (required): Executable and its arguments to benchmark; each command argument is passed directly by default."; "-S / --shell=default: Select the platform default shell for benchmarked commands: `sh` on Unix or `cmd.exe` on Windows."; "--shell <SHELL>: Select a shell for benchmarked commands; may be a shell name or path. Alternative to `-S`/`--shell=default`."; "--shell=none: Run benchmarked commands directly without an intermediate shell; this is the default in v2.0.0. Setup, prepare, conclude, and cleanup hooks still run in a shell."; "--setup <CMD>: Run once before each set of timing runs."; "--prepare <CMD>: Run before each timing run."; "--conclude <CMD>: Run after each timing run."; "--cleanup <CMD>: Run after completion of all benchmarking runs for each individual command."; "Prerequisite: Hyperfine must be installed and available as `hyperfine` on `PATH`."; "The previous default shell is stated as `sh` on Unix and `cmd.exe` on Windows."

## hyperfine --metrics selects benchmark metrics and units (hyperfine, 2026-10-07)
Published 2026-10-19
- slug: hyperfine-metrics-selects-benchmark-metrics-and-units-9067d922796f
- score: 0.98

How to use it:

When comparing benchmark commands, use `--metrics` to choose measurements; hyperfine otherwise displays wall-clock time and peak resident memory. Hardware counters require running without a shell, and their availability varies by platform.

Examples:

```
hyperfine --metrics memory_peak_resident:MiB,time_wall_clock:ms,instructions './baseline' './candidate'
```

- why_it_matters: Compare repository benchmark runs by wall-clock time, memory, or another supported performance metric.
- sources: <https://github.com/sharkdp/hyperfine/releases/tag/v2.0.0>, <https://github.com/sharkdp/hyperfine/blob/v2.0.0/README.md>
- gotchas: "Version: v2.0.0"; "--metrics <metrics>: Comma-separated metrics; each may have an optional unit. The documented default is `time_wall_clock,memory_peak_resident`."; "time_wall_clock: Elapsed time including waiting; seconds by default. Supported units: `ns`, `us`, `ms`, `s`, `min`, `h`."; "memory_peak_resident: Peak physical RAM usage; bytes by default. Supported units: `B`, `kB`, `MB`, `GB`, `TB`, `KiB`, `MiB`, `GiB`, `TiB`. Unsupported on Windows."; "time_user, time_system, time_cpu: User CPU time, kernel CPU time, and their total; seconds by default. `time_cpu` is user plus system time."; "cpu_cycles, instructions: CPU cycles and completed instructions. Hardware-counter units: `count`, `k`, `M`, `B`. Unsupported on Windows."; "cache_references, cache_misses, branch_misses: Cache accesses, cache misses, and mispredicted branches. Linux only; hardware-counter units are `count`, `k`, `M`, `B`."; "--metrics=default | time | all: Preset for default metrics, time metrics, or all available metrics. Presets are alternatives to an explicit metric list; docs do not describe combining them."; "<command>... (required): One or more benchmark commands; each argument is an executable and its arguments."; "Prerequisite: Hyperfine must be installed. Hardware counters are unavailable when a shell is enabled (`--shell=...`). Counter support depends on platform; see metric-specific availability."

Next: https://sincecutoff.com/v1/changes.md?tool=hyperfine&score=0&cursor=eyJzY29yZSI6MCwic2VxIjoxOTgzLCJzaW5jZSI6bnVsbCwidG9vbCI6Imh5cGVyZmluZSIsInYiOjF9
Save `next_cursor`; next visit, pass it to get only what was published since.
<!-- end of page -->
