changeset 39420:f0ea8b847831

revlog: early return in _slicechunk when density is already good We don't need to do anything if we know we won't enter the second while loop. Save the overhead of the first loop by returning earlier.
author Paul Morelle <paul.morelle@octobus.net>
date Tue, 19 Jun 2018 15:03:58 +0200
parents e3d18de56417
children d083ae26c325
files mercurial/revlog.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -234,6 +234,10 @@
     else:
         density = 1.0
 
+    if density >= revlog._srdensitythreshold:
+        yield revs
+        return
+
     # Store the gaps in a heap to have them sorted by decreasing size
     gapsheap = []
     heapq.heapify(gapsheap)