ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/testing/bench-revsets-git.txt
Yuya Nishihara 982062bd75 revset: do not always evaluate filter node to InternalRevset
This basically removes hidden 'all() &' from union/negation of filters. To
achieve that, I have two options: 1. add separate evaluation path (like the
one this commit introduced), or 2. wrap "all()" revset to override predicate
as Box::new(|_| true) function. I took the former since it's less ad-hoc.

We can add an explicit RevsetExpression node to branch between evaluate()
and evaluate_predicate(), but I don't think it would simplify the
implementation at this point. We might need such node if we want to resolve
"all()" at resolve_symbols(). It might be even better to extract a subset of
RevsetExpression enum, which only contains evaluatable nodes.

The cost of 'all() &' isn't significant for most filters. '~merges()' is
the exception. For jj repo,

    revsets/:v0.3.0 & (author(martinvonz) | committer(martinvonz))
    --------------------------------------------------------------
    base     1.06      11.2±0.04m
    new      1.00      10.5±0.05m

    revsets/~merges()
    -----------------
    base     1.69     750.0±8.47µ
    new      1.00     444.1±3.50µ
2023-04-04 15:21:21 +09:00

47 lines
1 KiB
Text

# Revsets to pass to `jj bench revsets` on the Git
# Single tags
v1.0.0
v2.40.0
# Old history
:v1.0.0
..v1.0.0
# More history
:v2.40.0
..v2.40.0
# Only recent history
v2.39.0..v2.40.0
:v2.40.0 ~ :v2.39.0
v2.39.0:v2.40.0
# Tags and branches
tags()
branches()
# Intersection of range with a small subset
tags() & :v2.40.0
v2.39.0 & :v2.40.0
# Author and committer
author(peff)
committer(gitster)
# Intersection and union of large subsets
author(peff) & committer(gitster)
author(peff) | committer(gitster)
# Intersection of filter with a small subset
:v1.0.0 & (author(peff) & committer(gitster))
:v1.0.0 & (author(peff) | committer(gitster))
# Roots and heads of small subsets
roots(tags())
heads(tags())
# Roots and heads of large subsets
roots(author(peff))
heads(author(peff))
# Roots and heads of range
roots(:v2.40.0)
heads(:v2.40.0)
# Parents and children of small subset
tags()-
tags()+
# Filter that doesn't read commit object
merges()
~merges()
# Files are unbearably slow, so only filter within small set
file(Makefile) & v1.0.0..v1.2.0