changeset 19708:fd4f612f7cb6 stable

bundle: fix performance regression when bundling file changes (issue4031) Somewhere before 2.7, a change [ec896f9e8894] was committed that entailed a large performance regression when bundling (and therefore remote cloning) repositories. For each file in the repository, it would recompute the set of needed changesets even though it is the same for all files. This computation would dominate bundle runtimes according to profiler output (by 10x or more).
author Antoine Pitrou <solipsis@pitrou.net>
date Sat, 07 Sep 2013 21:20:00 +0200
parents 26ddce1a2a55
children 600ea1a6884c 59df9e52b5bb
files mercurial/changegroup.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Tue Aug 06 00:52:06 2013 +0400
+++ b/mercurial/changegroup.py	Sat Sep 07 21:20:00 2013 +0200
@@ -354,11 +354,11 @@
         progress(msgbundling, None)
 
         mfs.clear()
+        needed = set(cl.rev(x) for x in clnodes)
 
         def linknodes(filerevlog, fname):
             if fastpathlinkrev:
                 ln, llr = filerevlog.node, filerevlog.linkrev
-                needed = set(cl.rev(x) for x in clnodes)
                 def genfilenodes():
                     for r in filerevlog:
                         linkrev = llr(r)