Mercurial > hg
comparison mercurial/revlog.py @ 39157: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 | 5517d62c1bcc |
comparison
equal
deleted
inserted
replaced
39156:b3b4bee161cf | 39157:a98e926b2f5b |
---|---|
2512 if base != nullrev: | 2512 if base != nullrev: |
2513 deltachain = self._deltachain(base)[0] | 2513 deltachain = self._deltachain(base)[0] |
2514 else: | 2514 else: |
2515 deltachain = [] | 2515 deltachain = [] |
2516 | 2516 |
2517 # search for the first non-snapshot revision | |
2518 for idx, r in enumerate(deltachain): | |
2519 if not self.issnapshot(r): | |
2520 break | |
2521 deltachain = deltachain[idx:] | |
2517 chunks = _slicechunk(self, deltachain, deltainfo) | 2522 chunks = _slicechunk(self, deltachain, deltainfo) |
2518 all_span = [_segmentspan(self, revs, deltainfo) for revs in chunks] | 2523 all_span = [_segmentspan(self, revs, deltainfo) for revs in chunks] |
2519 distance = max(all_span) | 2524 distance = max(all_span) |
2520 else: | 2525 else: |
2521 distance = deltainfo.distance | 2526 distance = deltainfo.distance |