##// END OF EJS Templates
perf: add a command to measure merge.calculateupdates perf...
Siddharth Agarwal -
r18817:c760acc6 default
parent child Browse files
Show More
@@ -2,7 +2,7 b''
2 '''helper extension to measure performance'''
2 '''helper extension to measure performance'''
3
3
4 from mercurial import cmdutil, scmutil, util, match, commands, obsolete
4 from mercurial import cmdutil, scmutil, util, match, commands, obsolete
5 from mercurial import repoview, branchmap
5 from mercurial import repoview, branchmap, merge
6 import time, os, sys
6 import time, os, sys
7
7
8 cmdtable = {}
8 cmdtable = {}
@@ -124,6 +124,22 b' def perfdirstatewrite(ui, repo):'
124 ds.write()
124 ds.write()
125 timer(d)
125 timer(d)
126
126
127 @command('perfmergecalculate',
128 [('r', 'rev', '.', 'rev to merge against')])
129 def perfmergecalculate(ui, repo, rev):
130 wctx = repo[None]
131 rctx = scmutil.revsingle(repo, rev, rev)
132 ancestor = wctx.ancestor(rctx)
133 # we don't want working dir files to be stat'd in the benchmark, so prime
134 # that cache
135 wctx.dirty()
136 def d():
137 # acceptremote is True because we don't want prompts in the middle of
138 # our benchmark
139 merge.calculateupdates(repo, wctx, rctx, ancestor, False, False, False,
140 acceptremote=True)
141 timer(d)
142
127 @command('perfmanifest')
143 @command('perfmanifest')
128 def perfmanifest(ui, repo):
144 def perfmanifest(ui, repo):
129 def d():
145 def d():
General Comments 0
You need to be logged in to leave comments. Login now