changeset 51551:6e4c8366c5ce

stream-clone: disable gc for the initial section for the v3 format The number of small container created turn Python in a gc-frenzy that seriously impact performance. This significantly boost performance. The following number comes from a large private repository using perf::stream-locked-section: base-line: 35.04 seconds prev-change: 24.51 seconds (-30%) prev-change: 20.88 seconds (-40%) this-change: 14.22 seconds (-60% from baseline; -31% from prev)
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 26 Mar 2024 13:34:05 +0000
parents 463e63aa547c
children 49faa72b994e
files mercurial/streamclone.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/streamclone.py	Tue Mar 26 13:32:46 2024 +0000
+++ b/mercurial/streamclone.py	Tue Mar 26 13:34:05 2024 +0000
@@ -850,7 +850,10 @@
     - ways to adjust the number of expected entries/files ?
     """
 
-    with repo.lock():
+    # Python is getting crazy at all the small container we creates while
+    # considering the files to preserve, disabling the gc while we do so helps
+    # performance a lot.
+    with repo.lock(), util.nogc():
 
         repo.ui.debug(b'scanning\n')