Merge pull request #899 from xfocus3/docs/compare-git-branches-606

docs: show how to benchmark across git branches
This commit is contained in:
David Peter authored and GitHub committed 2026-10-05 11:56:15 +02:00
commit 88a9150b4c
1 file changed
+10
+10
View File
@@ -88,6 +88,16 @@ option:
hyperfine -L compiler g++,clang++ '{compiler} -O2 main.cpp'
```
A common use case is comparing the same command across multiple Git branches. Use `--setup`
to switch branches once before each set of timing runs, so the branch switch is not part of
the measured command:
```sh
hyperfine \
--parameter-list branch main,performance-improvements \
--setup 'git switch {branch}' \
'python main.py'
```
### Intermediate shell
By default, commands are executed using `sh` on Unix (resolved through `PATH`) or `cmd.exe` on Windows.