[PATCH 3 of 5 STABLE v2] revset: more optimally handle __sub__ (issue4352)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Sep 18 00:26:26 CDT 2014



On 09/16/2014 08:42 PM, Pierre-Yves David wrote:
>
>
> On 09/08/2014 02:59 PM, Gregory Szorc wrote:
>> # HG changeset patch
>> # User Gregory Szorc <gregory.szorc at gmail.com>
>> # Date 1410195265 25200
>> #      Mon Sep 08 09:54:25 2014 -0700
>> # Node ID b2a51ed00298036887b54108e3c7faa10a2d8417
>> # Parent  3e8808bd267f9c2f6a650247a3a4ba926ee6c624
>> revset: more optimally handle __sub__ (issue4352)
>
> Ok so the regression here (before this patches) is that the substraction
> X - Y is done by doing a Y membership testing for all element in the X
> set. If the membership testing is expensive to do, this slow down
> significantly compared to doing the whole computation and using set
> membership testing.
>
> Before lazy revset we were doing the full computation and set membership
> test. This changeset reinstate this in the substraction case.
>
> This is good for set that are cheap to compute but for more expensive
> revset (like author), the membership testing on a few element may be
> more effective.
>
> The improvement added in another patches is doing full traversal of the
> X too.

My bad, the revset engine turns "X - Y" into "X - (X & Y)" (and this 
change is part of what make the whole thing slow).

However, the current thing is slow because lazy revset build a gigantic 
pile a crap and that element in the pile of crap itself are slow. In my 
opinion, the first move here is to make this pile of crap less pily and 
less crapy. I started playing in that direction and I got interesting 
results.

revset #0: roots((0::) - (0::tip))
0) wall 2.060527 comb 2.060000 user 2.050000 sys 0.010000 (best of 5)
1) wall 0.156491 comb 0.160000 user 0.160000 sys 0.000000 (best of 59)

I just sent another patch to do a quickfix on stable regarding the phase 
movement issue.


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list