Mercurial > hg
changeset 34825:4d5d5009bd75
revlog-sparse-read: add a lower-threshold for read block size
The option experimental.sparse-read.min-block-size specifies the minimal size
of a deltachain span, under which it won't be split by _slicechunk.
author | Paul Morelle <paul.morelle@octobus.net> |
---|---|
date | Sat, 14 Oct 2017 17:05:41 +0200 |
parents | e2ad93bcc084 |
children | 18a3274ed675 |
files | mercurial/configitems.py mercurial/localrepo.py mercurial/revlog.py |
diffstat | 3 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/configitems.py Tue Oct 10 17:50:27 2017 +0200 +++ b/mercurial/configitems.py Sat Oct 14 17:05:41 2017 +0200 @@ -417,6 +417,9 @@ coreconfigitem('experimental', 'sparse-read.density-threshold', default=0.25, ) +coreconfigitem('experimental', 'sparse-read.min-block-size', + default='256K', +) coreconfigitem('experimental', 'treemanifest', default=False, )
--- a/mercurial/localrepo.py Tue Oct 10 17:50:27 2017 +0200 +++ b/mercurial/localrepo.py Sat Oct 14 17:05:41 2017 +0200 @@ -611,8 +611,11 @@ withsparseread = self.ui.configbool('experimental', 'sparse-read') srdensitythres = float(self.ui.config('experimental', 'sparse-read.density-threshold')) + srminblocksize = self.ui.configbytes('experimental', + 'sparse-read.min-block-size') self.svfs.options['with-sparse-read'] = withsparseread self.svfs.options['sparse-read-density-threshold'] = srdensitythres + self.svfs.options['sparse-read-min-block-size'] = srminblocksize for r in self.requirements: if r.startswith('exp-compression-'):
--- a/mercurial/revlog.py Tue Oct 10 17:50:27 2017 +0200 +++ b/mercurial/revlog.py Sat Oct 14 17:05:41 2017 +0200 @@ -180,7 +180,7 @@ endbyte = start(revs[-1]) + length(revs[-1]) deltachainspan = endbyte - startbyte - if len(revs) <= 1: + if deltachainspan <= revlog._srminblocksize or len(revs) <= 1: yield revs continue @@ -360,6 +360,7 @@ self._maxdeltachainspan = -1 self._withsparseread = False self._srdensitythreshold = 0.25 + self._srminblocksize = 262144 mmapindexthreshold = None v = REVLOG_DEFAULT_VERSION @@ -389,6 +390,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 self._chunkcachesize <= 0: raise RevlogError(_('revlog chunk cache size %r is not greater '