# HG changeset patch # User Bryan O'Sullivan # Date 2013-02-09 23:51:32 # Node ID 5774732bb5e5fe7e51e1b15df29f69094b1f2270 # Parent 047110c0e2a8371b54e55a051b5e4f6753eca90d 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): @@ -432,7 +432,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(repo.ui, 0.001, getremove, (repo, mctx, overwrite), + workeractions) + for i, item in prog: z += i repo.ui.progress(_('updating'), z, item=item, total=numupdates, unit=_('files'))