Patchwork [10,of,11] merge: apply non-interactive working dir updates in parallel

mail settings
Submitter Bryan O'Sullivan
Date Feb. 9, 2013, 2:06 p.m.
Message ID <a278d66b8f8621ebafbb.1360418810@australite.local>
Download mbox | patch
Permalink /patch/874/
State Superseded
Commit d9ff580fcaa26199ab8d76f35f81169431ce84b3
Headers show


Bryan O'Sullivan - Feb. 9, 2013, 2:06 p.m.
# HG changeset patch
# User Bryan O'Sullivan <>
# Date 1360418465 0
# Node ID a278d66b8f8621ebafbb30a201000fca63983697
# Parent  dfb4e4bfedfc6db5fddf08b95276de01f1b1366d
merge: apply non-interactive working dir updates in parallel

This has a big effect on the performance of working dir updates.

Here are the results of update from null to the given rev in several
repos, on a Linux 3.2 system with 32 cores running ext4, with the progress
extension enabled.

repo             rev           plain  parallel   speedup
hg               7068089c95a2    0.9       0.3       3
mozilla-central  fe1600b22c77   42.8       7.7       5.5
linux-2.6        9ef4b770e069   31.4       4.9       6.4


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -7,7 +7,7 @@ 
 from node import nullid, nullrev, hex, bin
 from i18n import _
-import error, util, filemerge, copies, subrepo
+import error, util, filemerge, copies, subrepo, worker
 import errno, os, shutil
 class mergestate(object):
@@ -404,7 +404,9 @@  def applyupdates(repo, actions, wctx, mc
         subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
     z = 0
-    for i, item in getremove(repo, mctx, overwrite, workeractions):
+    prog = worker.worker(0.001, getremove, (repo, mctx, overwrite),
+                         workeractions)
+    for i, item in prog:
         z += i
         repo.ui.progress(_('updating'), z, item=item, total=numupdates,