diff mercurial/changelog.py @ 42446:055c3e2c44f0

revlog: speed up isancestor Currently, it is implemented on top of commonancestorsheads. Implement it on top of reachableroots instead, as reachableroots could stop walking the graph much sooner than commonancestorsheads. Measuring repo.changelog.isancestorrev on two revisions in a private repository: before: ! wall 0.005175 comb 0.010000 user 0.010000 sys 0.000000 (best of 550) after : ! wall 0.000072 comb 0.000000 user 0.000000 sys 0.000000 (best of 36199) When hg does this kind of operations 1500 times in pull -> bookmarks.comparebookmarks -> bookmarks.validdest, that's 11s that drop from the --profile output. Differential Revision: https://phab.mercurial-scm.org/D6506
author Valentin Gatien-Baron <vgatien-baron@janestreet.com>
date Mon, 10 Jun 2019 13:23:14 -0400
parents 027f1567f97f
children e3df1e15bee9
line wrap: on
line diff
--- a/mercurial/changelog.py	Mon Jun 10 11:40:43 2019 -0400
+++ b/mercurial/changelog.py	Mon Jun 10 13:23:14 2019 -0400
@@ -420,9 +420,6 @@
             if i not in self.filteredrevs:
                 yield i
 
-    def reachableroots(self, minroot, heads, roots, includepath=False):
-        return self.index.reachableroots2(minroot, heads, roots, includepath)
-
     def _checknofilteredinrevs(self, revs):
         """raise the appropriate error if 'revs' contains a filtered revision