mirror of
https://github.com/jj-vcs/jj.git
synced 2025-12-23 06:01:01 +00:00
This allows evaluating ancestors/ranges involving filters significantly faster. For instance, naively evaluating `::mine()` requires reading every commit in the repo to check `mine()` on each commit, then finding the ancestors of that set. This optimization rewrites `::mine()` to `::heads(mine())`, since `heads(mine())` can be evaluated more efficiently by only reading commits until the first successful match. If someone is unaware of how revsets are implemented, this case can come up pretty easily, such as by including `~mine()` in `immutable_heads()` to make other people's commits immutable. In my local `jj` repo, this optimization reduces the runtime of `jj log` with `~mine()` in `immutable_heads()` from about 800ms down to about 50ms. Benchmark results on Git repo: ``` ::(v1.0.0..v2.40.0) 55.5% faster author(peff).. 96.8% faster ``` |
||
|---|---|---|
| .. | ||
| bench-revsets-git.txt | ||
| fake-diff-editor.rs | ||
| fake-editor.rs | ||
| fake-formatter.rs | ||