Mercurial > public > mercurial-scm > hg
diff mercurial/streamclone.py @ 52997:e75ed9ae5fb9
stream-clone: adjust default value for worker and memory
Increasing the memory usage does not seems to yield much speed up, so we can
restrict it more aggressively. However, unlimited memory usage can overwhelm a
system and result in massive slowdown if the process start swapping. So it is
still possible to configure it, but it is not longer used in any default
profile.
Having too many workers can slow things a bit, but not too much. So we can try
to use higher default to yield benefit on large system.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 19 Feb 2025 02:45:09 +0100 |
parents | 5480647c2964 |
children | e705fec4a03f |
line wrap: on
line diff
--- a/mercurial/streamclone.py Wed Jan 29 02:45:58 2025 +0100 +++ b/mercurial/streamclone.py Wed Feb 19 02:45:09 2025 +0100 @@ -50,17 +50,17 @@ # update the configuration documentation if you touch this. DEFAULT_NUM_WRITER = { scmutil.RESOURCE_LOW: 1, - scmutil.RESOURCE_MEDIUM: 2, - scmutil.RESOURCE_HIGH: 4, + scmutil.RESOURCE_MEDIUM: 4, + scmutil.RESOURCE_HIGH: 8, } # Number arbitrarily picked, feel free to adjust them. Do update the # documentation if you do so DEFAULT_MEMORY_TARGET = { - scmutil.RESOURCE_LOW: 100 * (2**20), # 100 MB - scmutil.RESOURCE_MEDIUM: 2**30, # 1 GB - scmutil.RESOURCE_HIGH: None, + scmutil.RESOURCE_LOW: 50 * (2**20), # 100 MB + scmutil.RESOURCE_MEDIUM: 500 * 2**20, # 500 MB + scmutil.RESOURCE_HIGH: 2 * 2**30, # 2 GB }