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.
--- 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)