diff mercurial/revlog.py @ 34881:8c9b08a0c48c

sparse-read: skip gaps too small to be worth splitting Splitting at too small gaps might not be worthwhile. With this changeset, we stop considering splitting on too small gaps. The threshold is configurable. We arbitrarily pick 256K as a default value because it seems "okay". Further testing on various repositories and setups will be needed to tune it. The option name is 'experimental.sparse-read.min-gap-size`, and replaces `experimental.sparse-read.min-block-size` which is not used any more.
author Paul Morelle <paul.morelle@octobus.net>
date Wed, 18 Oct 2017 09:07:48 +0200
parents 9e18ab7f7240
children 1bde8e8e5de0
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Oct 18 12:53:00 2017 +0200
+++ b/mercurial/revlog.py	Wed Oct 18 09:07:48 2017 +0200
@@ -196,7 +196,8 @@
 
         if prevend is not None:
             gapsize = revstart - prevend
-            if gapsize:
+            # only consider holes that are large enough
+            if gapsize > revlog._srmingapsize:
                 heapq.heappush(gapsheap, (-gapsize, i))
 
         prevend = revstart + revlen
@@ -371,7 +372,7 @@
         self._maxdeltachainspan = -1
         self._withsparseread = False
         self._srdensitythreshold = 0.25
-        self._srminblocksize = 262144
+        self._srmingapsize = 262144
 
         mmapindexthreshold = None
         v = REVLOG_DEFAULT_VERSION
@@ -401,8 +402,8 @@
             self._withsparseread = bool(opts.get('with-sparse-read', False))
             if 'sparse-read-density-threshold' in opts:
                 self._srdensitythreshold = opts['sparse-read-density-threshold']
-            if 'sparse-read-min-block-size' in opts:
-                self._srminblocksize = opts['sparse-read-min-block-size']
+            if 'sparse-read-min-gap-size' in opts:
+                self._srmingapsize = opts['sparse-read-min-gap-size']
 
         if self._chunkcachesize <= 0:
             raise RevlogError(_('revlog chunk cache size %r is not greater '