changeset 39190:a98e926b2f5b

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.
author Paul Morelle <paul.morelle@octobus.net>
date Fri, 20 Jul 2018 13:20:01 +0200
parents b3b4bee161cf
children b0c73866c9fb
files mercurial/revlog.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)