changeset 38635:d083ae26c325

revlog: early return in _slicechunk when span is already small enough If the full span is smaller than the minimum gap size we'll consider, we know we won't do any slicing and we can return earlier.
author Boris Feld <boris.feld@octobus.net>
date Tue, 10 Jul 2018 15:17:05 -0700
parents f0ea8b847831
children 25534e0cf0d9
files mercurial/revlog.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Tue Jun 19 15:03:58 2018 +0200
+++ b/mercurial/revlog.py	Tue Jul 10 15:17:05 2018 -0700
@@ -227,6 +227,10 @@
     endbyte = start(revs[-1]) + length(revs[-1])
     readdata = deltachainspan = endbyte - startbyte
 
+    if deltachainspan < revlog._srmingapsize:
+        yield revs
+        return
+
     chainpayload = sum(length(r) for r in revs)
 
     if deltachainspan: