Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by GitHub · parents 862625f, 094d012 · Browse files · 1 file+10 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • docs: show how to benchmark across git branches

Diff stats

1 file+10 added−0 removed

  • other:+10 added−0 removed

1 file+10 added−0 removed

modified:README.md+10 added
86 unmodified lines
87```88hyperfine -L compiler g++,clang++ '{compiler} -O2 main.cpp'89```9091A common use case is comparing the same command across multiple Git branches. Use `--setup`92to switch branches once before each set of timing runs, so the branch switch is not part of93the measured command:94```sh95hyperfine \96 --parameter-list branch main,performance-improvements \97 --setup 'git switch {branch}' \98 'python main.py'99```100101### Intermediate shell102103By default, commands are executed using `sh` on Unix (resolved through `PATH`) or `cmd.exe` on Windows.104If you want to use a different shell, you can use the `-S, --shell <SHELL>` option:
244 unmodified lines