From patchwork Sat Sep 7 19:23:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [stable] bundle: fix performance regression when bundling file changes (issue4031) From: Antoine Pitrou X-Patchwork-Id: 2403 Message-Id: To: mercurial-devel@selenic.com Date: Sat, 07 Sep 2013 21:23:44 +0200 # HG changeset patch # User Antoine Pitrou # Date 1378581600 -7200 # Sat Sep 07 21:20:00 2013 +0200 # Branch stable # Node ID ca847f0aa6821652a2d58eb559adb5112e99249e # Parent e90c37d7d48c7cc9801c91071942f4119bbe380c bundle: fix performance regression when bundling file changes (issue4031) Somewhere before 2.7, a change 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). diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -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)