[Bug 4235] New: significant slow down on the `or` revset predicates

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu May 1 00:54:00 UTC 2014


http://bz.selenic.com/show_bug.cgi?id=4235

          Priority: normal
            Bug ID: 4235
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: significant slow down on the `or` revset predicates
          Severity: bug
    Classification: Unclassified
                OS: All
          Reporter: pierre-yves.david at ens-lyon.org
          Hardware: All
            Status: UNCONFIRMED
           Version: 3.0-rc
         Component: Mercurial
           Product: Mercurial

The revset `author(lmoscovicz) or author(mpm)` is about 50% slower with lazy
revset.

  2.9) wall 3.134191 comb 3.080000 user 3.080000 sys 0.000000 (best of 4)
  3.0) wall 4.312035 comb 4.250000 user 4.240000 sys 0.010000 (best of 3)



I tracked that down to the implementation of the `or` operator

  def orset(repo, subset, x, y):
      xl = getset(repo, subset, x)
      yl = getset(repo, subset - xl, y)
      return xl + yl

We subtract the result of `xl` to the set of element to be search by `yl`. This
is supposed to save time as the set of revision evaluated is smaller. In
practice dropping the substract give back the performance regression

Two kind of operation are going to be performed. (1) iterator and (2)
containment test. The lazyset class have a cache for both operation. Iterating
on the lazyset fill both, The iteration cache is filled at the end of the
iterator, and containment cache is filled on the go. However, containment test
does not touch the iteration cache.

The subtraction operation use containment test to subtract element from the
other set. It seems that this lead the conditional for author to be call twice,
once for iterator, once for subtraction.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list