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

Bryan O'Sullivan bos at serpentine.com
Sat Feb 9 08:06:50 CST 2013

# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# 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/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -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,

More information about the Mercurial-devel mailing list