comparison 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
comparison
equal deleted inserted replaced
51551:6e4c8366c5ce 51552:49faa72b994e
720 ) 720 )
721 progress.update(0) 721 progress.update(0)
722 with TempCopyManager() as copy, progress: 722 with TempCopyManager() as copy, progress:
723 # create a copy of volatile files 723 # create a copy of volatile files
724 for k, vfs, e in entries: 724 for k, vfs, e in entries:
725 for f in e.files(): 725 if e.maybe_volatile:
726 if f.is_volatile: 726 for f in e.files():
727 f.file_size(vfs) # record the expected size under lock 727 if f.is_volatile:
728 copy(vfs.join(f.unencoded_path)) 728 # record the expected size under lock
729 f.file_size(vfs)
730 copy(vfs.join(f.unencoded_path))
729 # the first yield release the lock on the repository 731 # the first yield release the lock on the repository
730 yield None 732 yield None
731 733
732 yield util.uvarintencode(total_entry_count) 734 yield util.uvarintencode(total_entry_count)
733 735