comparison mercurial/localrepo.py @ 51105:0250e45040f1

revlog: add a small cache of unfiltered chunk This can provides a massive boost to the reading of multiple revision and the computation of a valid delta chain. This greatly help operation like `hg log --patch`, delta computation (helping pull/unbundle), linkrev adjustment (helping copy tracing). A first round of benchmark for `hg log --patch --limit 1000` shows improvement in the 10-20% range on "small" repository like pypy or mercurial and large improvements (about 33%) for more complex ones like netbeans and mozilla's. These speeds up are consistent with the improvement to `hg pull` (from a server sending poor deltas) I saw benchmarking this last year. Further benchmark will be run during the freeze. I added some configuration in the experimental space to be able to further test the effect of various tuning for now. This feature should fit well in the "usage/resource profile" configuration that we should land next cycle. When it does not provides a benefit the overhead of the cache seem to be around 2%, a small price for the big improvement. In addition I believe we could shave most of this overhead with a more efficent lru implementation.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 27 Oct 2023 08:54:41 +0200
parents 1c0f3994d733
children 498017baa34b
comparison
equal deleted inserted replaced
51104:c2d2e5b65def 51105:0250e45040f1
1086 1086
1087 # experimental config: format.chunkcachesize 1087 # experimental config: format.chunkcachesize
1088 chunkcachesize = ui.configint(b'format', b'chunkcachesize') 1088 chunkcachesize = ui.configint(b'format', b'chunkcachesize')
1089 if chunkcachesize is not None: 1089 if chunkcachesize is not None:
1090 data_config.chunk_cache_size = chunkcachesize 1090 data_config.chunk_cache_size = chunkcachesize
1091
1092 if ui.configbool(b'experimental', b'revlog.uncompressed-cache.enabled'):
1093 factor = ui.configint(
1094 b'experimental', b'revlog.uncompressed-cache.factor'
1095 )
1096 count = ui.configint(
1097 b'experimental', b'revlog.uncompressed-cache.count'
1098 )
1099 data_config.uncompressed_cache_factor = factor
1100 data_config.uncompressed_cache_count = count
1091 1101
1092 delta_config.delta_both_parents = ui.configbool( 1102 delta_config.delta_both_parents = ui.configbool(
1093 b'storage', b'revlog.optimize-delta-parent-choice' 1103 b'storage', b'revlog.optimize-delta-parent-choice'
1094 ) 1104 )
1095 delta_config.candidate_group_chunk_size = ui.configint( 1105 delta_config.candidate_group_chunk_size = ui.configint(