Current state of revset performance.

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Oct 31 14:07:17 CDT 2014


Here is a quick analysis of the benchmark. Bad neew (regression) are at 
the end of this email.

TL;DR:
- We do a better job overall,
- Some revset get the lazyness boost they deserve.
- We are still slower//not taking advantage of lazyness in multiple case.
- We have regression in `roots(…)` and X:: - X


Longer version:

Revision:
0) 2.9.2
1) 3.0.2
2) 3.1.2
3) @ (6df4bc39f682)

benchmark are made on mercurial-devel with multiple heads but no hidden 
changesets.

Best for all case:
==================

We are no longer slower than before and even take avantage of the 
lazyness of
revset for main iteration and first/last.

   revset #0: all()
        plain           first           last
   0)   0.006786        0.010800        0.010913
   1)   0.007517   110% 0.000067     0% 0.000068     0%
   3)   0.002017    29% 0.000057     0% 0.000058     0%

   revset #13: roots((tip~100::) - (tip~100::tip))
        plain           first           last
   0)   0.034687        0.043165        0.042474
   1)   0.092367   266% 0.092202   213% 0.091826   216%
   3)   0.007388    21% 0.007371    17% 0.007353    17%

   revset #22: parents(20000)
        plain           first           last
   0)   0.001072        0.001895        0.001894
   1)   0.001455   135% 0.001282    67% 0.000308    16%
   3)   0.000093     8% 0.000116     6% 0.000117     6%


No regression + lazy banefit
============================

We are no lower slower for the main iteration and we can take advantage of
lazyness for first or last.

   revset #1: draft()
        plain           first           last
   0)   0.008182        0.009183        0.009022
   1)   0.010656   130% 0.010673   116% 0.000073     0%
   3)   0.008268        0.008257    89% 0.000063     0%


   revset #10: author(mpm) or author(lmoscovicz)
        plain           first           last
   0)   2.175475        2.147277        2.190208
   1)   3.145430   144% 1.610150    74% 3.430908   156%
   2)   3.169045   145% 1.637919    76% 3.169588   144%
   3)   2.206914        0.000124     0% 2.191002

Doing better but still bad
==========================

We are faster for multiple revsets but still significantly slower than the
original implementation.


   revset #2: ::tip
        plain           first           last
   0)   0.027052        0.027483        0.027422
   1)   0.063356   234% 0.056368   205% 0.000123     0%
   2)   0.064666   239% 0.057509   209% 0.000128     0%
   3)   0.051750   191% 0.050233   182% 0.000116     0%

   revset #2: ::tip
        plain           first           last
   0)   0.280741        0.280493        0.283894
   1)   0.769780   274% 0.690721   246% 0.000121     0%
   2)   0.803637   286% 0.696153   248% 0.000127     0%
   3)   0.654392   233% 0.667881   238% 0.000116     0%

   revset #11: tip:0 (mozilla run)
        plain           first           last
   0)   0.030447        0.036552        0.036424
   1)   0.085987   282% 0.002484     6% 0.002369     6%
   2)   0.085359   280% 0.002372     6% 0.002478     6%
   3)   0.052133   171% 0.002337     6% 0.002362     6%

   revset #12: 0:: (mozilla run)
        plain           first           last
   0)   0.256131        0.264171        0.263897
   1)   0.578819   225% 0.000134     0% 0.539618   204%
   2)   0.571131   222% 0.000138     0% 0.534933   202%
   3)   0.289868   113% 0.000125     0% 0.375199   142%

   revset #15: ::p1(p1(tip))::
        plain           first           last
   0)   0.058441        0.059322        0.059688
   1)   0.167296   286% 0.072087   121% 0.163829   274%
   2)   0.174026   297% 0.072762   122% 0.166785   279%
   3)   0.097599   167% 0.051359    86% 0.093226   156%

   revset #17: :10000 and public()
        plain           first           last
   0)   0.005351        0.007019        0.007057
   1)   0.009301   173% 0.000325     4% 0.000325     4%
   2)   0.009295   173% 0.000330     4% 0.000333     4%
   3)   0.007349   137% 0.000310     4% 0.000311     4%

   revset #24: (children(ancestor(tip~5, tip)) and ::(tip~5))::
        plain           first           last
   0)   0.031496        0.031880        0.031696
   1)   0.079510   252% 0.080726   253% 0.081683   257%
   2)   0.074485   236% 0.074235   232% 0.074772   235%
   3)   0.051772   164% 0.051106   160% 0.053094   167%

Performance regression
==========================

We have a significant regression in "roots". Roots is forcing its 
element to be
non lazy and it doing non-trivial but suboptimal operation. One will need to
poke at the implementation in 3.3 to make it both lazy and efficient.

   revset #6: roots(0::tip)
        plain           first           last
   0)   0.053484        0.057963        0.057493
   1)   0.073101   136% 0.074129   127% 0.072838   126%
   2)   0.073549   137% 0.072265   124% 0.071966   125%
   3)   0.112967   211% 0.106681   184% 0.109084   189%

   revset #14: roots((0::) - (0::tip)) (mozilla run)
        plain           first           last
   0)   0.661421        0.649430        0.640142
   1)   391.611347 59207% 391.789948 60328% 391.887884 61218%
   2)   1.163275   175% 1.151022   177% 1.154920   180%
   3)   1.149652   173% 1.160350   178% 1.149502   179%

We also have a bad regression here. I just discovered it so I've no idea 
where it comes from.

   revset #23: (20000::) - (20000)
        plain           first           last
   0)   0.005060        0.006131        0.006144
   1)   0.013211   261% 0.005674    92% 0.013004   211%
   2)   0.012788   252% 0.005525    90% 0.012252   199%
   3)   0.023453   463% 0.022214   362% 0.007272   118%


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list