changeset 52999: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 3fb2fbad4b13
files mercurial/configitems.toml mercurial/streamclone.py
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/configitems.toml	Wed Jan 29 02:45:58 2025 +0100
+++ b/mercurial/configitems.toml	Wed Feb 19 02:45:09 2025 +0100
@@ -2949,6 +2949,12 @@
 
 # experimental until we are happy with the implementation and some sanity
 # checking has been done.
+#
+# At the time of the 7.0 freeze, the threaded code is faster is some case and
+# slower in some other. So it is not ready to be installed by default.
+#
+# The correct number of writers is hard to adjust as it strongly depends of the
+# OS, disk setup and number of CPU. so more tuning is needed.
 [[items]]
 section = "worker"
 name = "parallel-stream-bundle-processing"
--- 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
 }