diff mercurial/streamclone.py @ 51552:49faa72b994e

streamclone: stop listing files for entries that have no volatile files This will save a lot of python related time. 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%) prev-change: 14.22 seconds (-60%) this-change: 11.58 seconds (-67% from baseline; -18% from prev)
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 26 Mar 2024 13:46:44 +0000
parents 6e4c8366c5ce
children 8cd317c033b8
line wrap: on
line diff
--- a/mercurial/streamclone.py	Tue Mar 26 13:34:05 2024 +0000
+++ b/mercurial/streamclone.py	Tue Mar 26 13:46:44 2024 +0000
@@ -722,10 +722,12 @@
     with TempCopyManager() as copy, progress:
         # create a copy of volatile files
         for k, vfs, e in entries:
-            for f in e.files():
-                if f.is_volatile:
-                    f.file_size(vfs)  # record the expected size under lock
-                    copy(vfs.join(f.unencoded_path))
+            if e.maybe_volatile:
+                for f in e.files():
+                    if f.is_volatile:
+                        # record the expected size under lock
+                        f.file_size(vfs)
+                        copy(vfs.join(f.unencoded_path))
         # the first yield release the lock on the repository
         yield None