docs: show how to benchmark across git branches#899
Conversation
ded-furby
left a comment
There was a problem hiding this comment.
Nice example. One side effect that may be worth calling out explicitly in the surrounding text: after the benchmark finishes, the repo will still be left on the last branch from because mutates checkout state outside the timed command.\n\nSince the paragraph already warns about a clean working tree, an extra sentence about ending on the final branch would help avoid surprising users who run this in their main checkout instead of a disposable worktree.
ded-furby
left a comment
There was a problem hiding this comment.
Nice example. One side effect that may be worth calling out explicitly in the surrounding text: after the benchmark finishes, the repo will still be left on the last branch from --parameter-list because --setup 'git switch {branch}' mutates checkout state outside the timed command.
Since the paragraph already warns about a clean working tree, an extra sentence about ending on the final branch would help avoid surprising users who run this in their main checkout instead of a disposable worktree.
Summary
--parameter-listwith--setup 'git switch {branch}'so branch switching is outside the timed command.git worktreefor benchmarking uncommitted changes.Closes #606.
Verification
src/benchmark/mod.rsthat--setupreceives parameter substitution and runs before the set of timing runs.git diff --check.