# HG changeset patch # User Paul Morelle # Date 2018-07-20 11:20:01 # Node ID a98e926b2f5b2404f2255f56fa967389550a0b96 # Parent b3b4bee161cf0bbe264822d3624265fba728a1bc 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. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -2514,6 +2514,11 @@ class revlog(object): 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)