Skip to content

docs: show how to benchmark across git branches#899

Open
xfocus3 wants to merge 2 commits into
sharkdp:masterfrom
xfocus3:docs/compare-git-branches-606
Open

docs: show how to benchmark across git branches#899
xfocus3 wants to merge 2 commits into
sharkdp:masterfrom
xfocus3:docs/compare-git-branches-606

Conversation

@xfocus3
Copy link
Copy Markdown

@xfocus3 xfocus3 commented Jun 1, 2026

Summary

  • Add a README example for benchmarking the same command across Git branches.
  • Use --parameter-list with --setup 'git switch {branch}' so branch switching is outside the timed command.
  • Mention git worktree for benchmarking uncommitted changes.

Closes #606.

Verification

  • Confirmed in src/benchmark/mod.rs that --setup receives parameter substitution and runs before the set of timing runs.
  • Ran git diff --check.

Copy link
Copy Markdown

@ded-furby ded-furby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@ded-furby ded-furby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Benchmark across different branches

3 participants