comparison 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
comparison
equal deleted inserted replaced
34823:7891d243d821 34824:e2ad93bcc084
606 self.svfs.options['maxdeltachainspan'] = chainspan 606 self.svfs.options['maxdeltachainspan'] = chainspan
607 mmapindexthreshold = self.ui.configbytes('experimental', 607 mmapindexthreshold = self.ui.configbytes('experimental',
608 'mmapindexthreshold') 608 'mmapindexthreshold')
609 if mmapindexthreshold is not None: 609 if mmapindexthreshold is not None:
610 self.svfs.options['mmapindexthreshold'] = mmapindexthreshold 610 self.svfs.options['mmapindexthreshold'] = mmapindexthreshold
611 withsparseread = self.ui.configbool('experimental', 'sparse-read')
612 srdensitythres = float(self.ui.config('experimental',
613 'sparse-read.density-threshold'))
614 self.svfs.options['with-sparse-read'] = withsparseread
615 self.svfs.options['sparse-read-density-threshold'] = srdensitythres
611 616
612 for r in self.requirements: 617 for r in self.requirements:
613 if r.startswith('exp-compression-'): 618 if r.startswith('exp-compression-'):
614 self.svfs.options['compengine'] = r[len('exp-compression-'):] 619 self.svfs.options['compengine'] = r[len('exp-compression-'):]
615 620