diff mercurial/localrepo.py @ 34824:e2ad93bcc084

revlog: introduce an experimental flag to slice chunks reads when too sparse Delta chains can become quite sparse if there is a lot of unrelated data between relevant pieces. Right now, revlog always reads all the necessary data for the delta chain in one single read. This can lead to a lot of unrelated data to be read (see issue5482 for more details). One can use the `experimental.maxdeltachainspan` option with a large value (or -1) to easily produce a very sparse delta chain. This change introduces the ability to slice the chunks retrieval into multiple reads, skipping large sections of unrelated data. Preliminary testing shows interesting results. For example the peak memory consumption to read a manifest on a large repository is reduced from 600MB to 250MB (200MB without maxdeltachainspan). However, the slicing itself and the multiple reads can have an negative impact on performance. This is why the new feature is hidden behind an experimental flag. Future changesets will add various parameters to control the slicing heuristics. We hope to experiment a wide variety of repositories during 4.4 and hopefully turn the feature on by default in 4.5. As a first try, the algorithm itself is prone to deep changes. However, we wish to define APIs and have a baseline to work on.
author Paul Morelle <paul.morelle@octobus.net>
date Tue, 10 Oct 2017 17:50:27 +0200
parents f6d17075608f
children 4d5d5009bd75
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Oct 09 15:13:41 2017 +0200
+++ b/mercurial/localrepo.py	Tue Oct 10 17:50:27 2017 +0200
@@ -608,6 +608,11 @@
                                                  'mmapindexthreshold')
         if mmapindexthreshold is not None:
             self.svfs.options['mmapindexthreshold'] = mmapindexthreshold
+        withsparseread = self.ui.configbool('experimental', 'sparse-read')
+        srdensitythres = float(self.ui.config('experimental',
+                                              'sparse-read.density-threshold'))
+        self.svfs.options['with-sparse-read'] = withsparseread
+        self.svfs.options['sparse-read-density-threshold'] = srdensitythres
 
         for r in self.requirements:
             if r.startswith('exp-compression-'):