# HG changeset patch # User Paul Morelle # Date 1532085601 -7200 # 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 -r b3b4bee161cf -r a98e926b2f5b 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)