diff mercurial/revlog.py @ 38634: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 eb8504715071
children d083ae26c325
line wrap: on
line diff
--- a/mercurial/revlog.py	Tue Jul 10 02:33:43 2018 +0200
+++ b/mercurial/revlog.py	Tue Jun 19 15:03:58 2018 +0200
@@ -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)