Open technicalpickles opened 1 year ago
You can do this using a combination of --parameter-list
and --setup
. Something like the following should work:
hyperfine \
--parameter-list branch main,performance-improvements \
--setup "git switch {branch}" \
"rails runner true"
When I'm working on performance, I tend to want to compare a baseline from our main branch against my current work.
This is indeed a very common use case. We should probably write some documentation for that.
Another way to do this is to use git worktree
to have both main/master branch and your work
branch checked out and built and run the benchmark with both. This way you can run benchmarks
with uncommitted changes.
When I'm working on performance, I tend to want to compare a baseline from our main branch against my current work. It'd be pretty handy to be able to specify branches at the CLI level to handle the switch. Maybe:
You can achieve something similar by including the git checkouts in the command: