Show More
@@ -475,20 +475,23 def perfdiffwd(ui, repo, **opts): | |||||
475 | fm.end() |
|
475 | fm.end() | |
476 |
|
476 | |||
477 | @command('perfrevlog', revlogopts + formatteropts + |
|
477 | @command('perfrevlog', revlogopts + formatteropts + | |
478 |
[('d', 'dist', 100, 'distance between the revisions') |
|
478 | [('d', 'dist', 100, 'distance between the revisions'), | |
|
479 | ('s', 'startrev', 0, 'revision to start reading at')], | |||
479 | '-c|-m|FILE') |
|
480 | '-c|-m|FILE') | |
480 | def perfrevlog(ui, repo, file_=None, **opts): |
|
481 | def perfrevlog(ui, repo, file_=None, startrev=0, **opts): | |
481 | """Benchmark reading a series of revisions from a revlog. |
|
482 | """Benchmark reading a series of revisions from a revlog. | |
482 |
|
483 | |||
483 | By default, we read every ``-d/--dist`` revision from 0 to tip of |
|
484 | By default, we read every ``-d/--dist`` revision from 0 to tip of | |
484 | the specified revlog. |
|
485 | the specified revlog. | |
|
486 | ||||
|
487 | The start revision can be defined via ``-s/--startrev``. | |||
485 | """ |
|
488 | """ | |
486 | timer, fm = gettimer(ui, opts) |
|
489 | timer, fm = gettimer(ui, opts) | |
487 | dist = opts['dist'] |
|
490 | dist = opts['dist'] | |
488 | _len = getlen(ui) |
|
491 | _len = getlen(ui) | |
489 | def d(): |
|
492 | def d(): | |
490 | r = cmdutil.openrevlog(repo, 'perfrevlog', file_, opts) |
|
493 | r = cmdutil.openrevlog(repo, 'perfrevlog', file_, opts) | |
491 |
for x in xrange( |
|
494 | for x in xrange(startrev, _len(r), dist): | |
492 | r.revision(r.node(x)) |
|
495 | r.revision(r.node(x)) | |
493 |
|
496 | |||
494 | timer(d) |
|
497 | timer(d) |
General Comments 0
You need to be logged in to leave comments.
Login now