bench: Add benchmarks for revset graph#9025
bench: Add benchmarks for revset graph#9025ThierryBerger wants to merge 1 commit intojj-vcs:mainfrom
Conversation
PhilipMetzger
left a comment
There was a problem hiding this comment.
Please expand the motivation in the commit description not on the PR page since the project cares more about individual commits instead of PR descriptions.
9180c77 to
2034129
Compare
lib/benches/revset_graph_bench.rs
Outdated
| let index: &DefaultReadonlyIndex = repo.readonly_index().downcast_ref().unwrap(); | ||
| let expression = | ||
| ResolvedExpression::Commits(vec![root_visible.id().clone(), tip_visible.id().clone()]); | ||
| let revset = index | ||
| .evaluate_revset_impl(&expression, repo.store()) | ||
| .unwrap(); |
There was a problem hiding this comment.
Should we use the external API instead here? I suppose it adds a little bit of overhead, but the timing of the internal API doesn't really matter anyway: if we make changes to the default revset engine that impact performance in a small enough way that it's drowned out by the overhead of the external API, then the performance impact doesn't matter anyway (whether it's positive or negative).
(same applies to the other benchmark below)
There was a problem hiding this comment.
Indeed, I'm not too familiar with the API, I changed it to use:
RevsetExpression::commitsrevset.iter_graph()TopoGroupedGraphIterator
I can't use directly log because it's in the cli crate.
Edit: I consider this resolved but I think I shouldn't be the one resolving reviews, just a heads up since that's blocking CI
2034129 to
6e61333
Compare
This adds simple, isolated and reproducible benchmarks for revsets. ## Context - While working on jj-vcs#8968 ; performance was mentioned, as well as trying impacts on big repositories such as linux. Cloning a big repository to test performance is cumbersome, difficult to compare baseline for, and not intuitive. From what I understand, `jj bench log` is what's used right now by jj developers, with https://github.com/jj-vcs/jj/blob/main/cli/testing/bench-revsets-git.txt being a suggestion of revset to pass to. This file is regularly outdated so using it wasn't very fun. ## Details on this PR - This builds on what exists on this repository, within `lib/benches`. It seems a bit underused/old, but still on the repository so I'm hopeful that the design is still relevant. - No additional dependencies - Small by design, I want a baseline performance comparison for future discussions on jj-vcs#8968, or other topics. - Future possibilities: This is a simpler setup to run on a CI: `cargo bench`
6e61333 to
82ec9f4
Compare
|
Somewhat related: I think it's also good to add |
This adds simple, isolated and reproducible benchmarks for revsets.
Context
Cloning a big repository to test performance is cumbersome, difficult to compare baseline for, and not intuitive.
From what I understand,
jj bench logis what's used right now by jj developers, with https://github.com/jj-vcs/jj/blob/main/cli/testing/bench-revsets-git.txt being a suggestion of revset to pass to. This file is regularly outdated so using it wasn't very fun.Details on this PR
lib/benches. It seems a bit underused/old, but still on the repository so I'm hopeful that the design is still relevant.cargo benchChecklist
If applicable:
CHANGELOG.mdREADME.md,docs/,demos/)cli/src/config-schema.json)how it works, how it's organized), including any code drafted by AI
eye towards deleting anything that is irrelevant, clarifying anything that
is confusing, and adding details that are relevant. This includes, for
example, commit descriptions, PR descriptions, and code comments.