revlog: only consider the span of the delta section
authorPaul Morelle <paul.morelle@octobus.net>
Fri, 20 Jul 2018 13:20:01 +0200
changeset 39157 a98e926b2f5b
parent 39156 b3b4bee161cf
child 39158 b0c73866c9fb
revlog: only consider the span of the delta section Since the number of snapshots is limited we can exclude them from the logic checking size and number of reads. Limiting the span computation to the delta section will allow for further optimization.
mercurial/revlog.py
--- a/mercurial/revlog.py	Mon Jul 23 16:21:58 2018 +0200
+++ b/mercurial/revlog.py	Fri Jul 20 13:20:01 2018 +0200
@@ -2514,6 +2514,11 @@
             else:
                 deltachain = []
 
+            # search for the first non-snapshot revision
+            for idx, r in enumerate(deltachain):
+                if not self.issnapshot(r):
+                    break
+            deltachain = deltachain[idx:]
             chunks = _slicechunk(self, deltachain, deltainfo)
             all_span = [_segmentspan(self, revs, deltainfo) for revs in chunks]
             distance = max(all_span)