Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
52996:5480647c2964 | 52997:e75ed9ae5fb9 |
---|---|
48 # Number arbitrarily picked, feel free to change them (but the LOW one) | 48 # Number arbitrarily picked, feel free to change them (but the LOW one) |
49 # | 49 # |
50 # update the configuration documentation if you touch this. | 50 # update the configuration documentation if you touch this. |
51 DEFAULT_NUM_WRITER = { | 51 DEFAULT_NUM_WRITER = { |
52 scmutil.RESOURCE_LOW: 1, | 52 scmutil.RESOURCE_LOW: 1, |
53 scmutil.RESOURCE_MEDIUM: 2, | 53 scmutil.RESOURCE_MEDIUM: 4, |
54 scmutil.RESOURCE_HIGH: 4, | 54 scmutil.RESOURCE_HIGH: 8, |
55 } | 55 } |
56 | 56 |
57 | 57 |
58 # Number arbitrarily picked, feel free to adjust them. Do update the | 58 # Number arbitrarily picked, feel free to adjust them. Do update the |
59 # documentation if you do so | 59 # documentation if you do so |
60 DEFAULT_MEMORY_TARGET = { | 60 DEFAULT_MEMORY_TARGET = { |
61 scmutil.RESOURCE_LOW: 100 * (2**20), # 100 MB | 61 scmutil.RESOURCE_LOW: 50 * (2**20), # 100 MB |
62 scmutil.RESOURCE_MEDIUM: 2**30, # 1 GB | 62 scmutil.RESOURCE_MEDIUM: 500 * 2**20, # 500 MB |
63 scmutil.RESOURCE_HIGH: None, | 63 scmutil.RESOURCE_HIGH: 2 * 2**30, # 2 GB |
64 } | 64 } |
65 | 65 |
66 | 66 |
67 def new_stream_clone_requirements( | 67 def new_stream_clone_requirements( |
68 default_requirements: Iterable[bytes], | 68 default_requirements: Iterable[bytes], |