Mercurial > public > mercurial-scm > hg-stable
diff contrib/perf.py @ 18817:c760acc6f69d
perf: add a command to measure merge.calculateupdates perf
The performance of merge.manifestmerge will be improved in upcoming patches.
This command will be used to demonstrate the improvement.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Sun, 24 Mar 2013 17:06:10 -0700 |
parents | 3e92772d5383 |
children | 70000d0c44f5 |
line wrap: on
line diff
--- a/contrib/perf.py Mon Mar 25 16:57:36 2013 -0700 +++ b/contrib/perf.py Sun Mar 24 17:06:10 2013 -0700 @@ -2,7 +2,7 @@ '''helper extension to measure performance''' from mercurial import cmdutil, scmutil, util, match, commands, obsolete -from mercurial import repoview, branchmap +from mercurial import repoview, branchmap, merge import time, os, sys cmdtable = {} @@ -124,6 +124,22 @@ ds.write() timer(d) +@command('perfmergecalculate', + [('r', 'rev', '.', 'rev to merge against')]) +def perfmergecalculate(ui, repo, rev): + wctx = repo[None] + rctx = scmutil.revsingle(repo, rev, rev) + ancestor = wctx.ancestor(rctx) + # we don't want working dir files to be stat'd in the benchmark, so prime + # that cache + wctx.dirty() + def d(): + # acceptremote is True because we don't want prompts in the middle of + # our benchmark + merge.calculateupdates(repo, wctx, rctx, ancestor, False, False, False, + acceptremote=True) + timer(d) + @command('perfmanifest') def perfmanifest(ui, repo): def d():