Show More
@@ -25,6 +25,7 import random | |||||
25 | import sys |
|
25 | import sys | |
26 | import time |
|
26 | import time | |
27 | from mercurial import ( |
|
27 | from mercurial import ( | |
|
28 | changegroup, | |||
28 | cmdutil, |
|
29 | cmdutil, | |
29 | commands, |
|
30 | commands, | |
30 | copies, |
|
31 | copies, | |
@@ -279,6 +280,37 def perfancestorset(ui, repo, revset, ** | |||||
279 | timer(d) |
|
280 | timer(d) | |
280 | fm.end() |
|
281 | fm.end() | |
281 |
|
282 | |||
|
283 | @command('perfchangegroupchangelog', formatteropts + | |||
|
284 | [('', 'version', '02', 'changegroup version'), | |||
|
285 | ('r', 'rev', '', 'revisions to add to changegroup')]) | |||
|
286 | def perfchangegroupchangelog(ui, repo, version='02', rev=None, **opts): | |||
|
287 | """Benchmark producing a changelog group for a changegroup. | |||
|
288 | ||||
|
289 | This measures the time spent processing the changelog during a | |||
|
290 | bundle operation. This occurs during `hg bundle` and on a server | |||
|
291 | processing a `getbundle` wire protocol request (handles clones | |||
|
292 | and pull requests). | |||
|
293 | ||||
|
294 | By default, all revisions are added to the changegroup. | |||
|
295 | """ | |||
|
296 | cl = repo.changelog | |||
|
297 | revs = [cl.lookup(r) for r in repo.revs(rev or 'all()')] | |||
|
298 | bundler = changegroup.getbundler(version, repo) | |||
|
299 | ||||
|
300 | def lookup(node): | |||
|
301 | # The real bundler reads the revision in order to access the | |||
|
302 | # manifest node and files list. Do that here. | |||
|
303 | cl.read(node) | |||
|
304 | return node | |||
|
305 | ||||
|
306 | def d(): | |||
|
307 | for chunk in bundler.group(revs, cl, lookup): | |||
|
308 | pass | |||
|
309 | ||||
|
310 | timer, fm = gettimer(ui, opts) | |||
|
311 | timer(d) | |||
|
312 | fm.end() | |||
|
313 | ||||
282 | @command('perfdirs', formatteropts) |
|
314 | @command('perfdirs', formatteropts) | |
283 | def perfdirs(ui, repo, **opts): |
|
315 | def perfdirs(ui, repo, **opts): | |
284 | timer, fm = gettimer(ui, opts) |
|
316 | timer, fm = gettimer(ui, opts) |
@@ -53,6 +53,8 perfstatus | |||||
53 | perfbranchmap |
|
53 | perfbranchmap | |
54 | benchmark the update of a branchmap |
|
54 | benchmark the update of a branchmap | |
55 | perfcca (no help text available) |
|
55 | perfcca (no help text available) | |
|
56 | perfchangegroupchangelog | |||
|
57 | Benchmark producing a changelog group for a changegroup. | |||
56 | perfchangeset |
|
58 | perfchangeset | |
57 | (no help text available) |
|
59 | (no help text available) | |
58 | perfctxfiles (no help text available) |
|
60 | perfctxfiles (no help text available) | |
@@ -112,6 +114,7 perfstatus | |||||
112 | $ hg perfannotate a |
|
114 | $ hg perfannotate a | |
113 | $ hg perfbranchmap |
|
115 | $ hg perfbranchmap | |
114 | $ hg perfcca |
|
116 | $ hg perfcca | |
|
117 | $ hg perfchangegroupchangelog | |||
115 | $ hg perfchangeset 2 |
|
118 | $ hg perfchangeset 2 | |
116 | $ hg perfctxfiles 2 |
|
119 | $ hg perfctxfiles 2 | |
117 | $ hg perfdiffwd |
|
120 | $ hg perfdiffwd |
General Comments 0
You need to be logged in to leave comments.
Login now