##// END OF EJS Templates
perf: add --reverse to perfrevlog...
Gregory Szorc -
r30017:973cf6c3 default
parent child Browse files
Show More
@@ -580,9 +580,10 b' def perfdiffwd(ui, repo, **opts):'
580 580
581 581 @command('perfrevlog', revlogopts + formatteropts +
582 582 [('d', 'dist', 100, 'distance between the revisions'),
583 ('s', 'startrev', 0, 'revision to start reading at')],
583 ('s', 'startrev', 0, 'revision to start reading at'),
584 ('', 'reverse', False, 'read in reverse')],
584 585 '-c|-m|FILE')
585 def perfrevlog(ui, repo, file_=None, startrev=0, **opts):
586 def perfrevlog(ui, repo, file_=None, startrev=0, reverse=False, **opts):
586 587 """Benchmark reading a series of revisions from a revlog.
587 588
588 589 By default, we read every ``-d/--dist`` revision from 0 to tip of
@@ -591,11 +592,20 b' def perfrevlog(ui, repo, file_=None, sta'
591 592 The start revision can be defined via ``-s/--startrev``.
592 593 """
593 594 timer, fm = gettimer(ui, opts)
594 dist = opts['dist']
595 595 _len = getlen(ui)
596
596 597 def d():
597 598 r = cmdutil.openrevlog(repo, 'perfrevlog', file_, opts)
598 for x in xrange(startrev, _len(r), dist):
599
600 startrev = 0
601 endrev = _len(r)
602 dist = opts['dist']
603
604 if reverse:
605 startrev, endrev = endrev, startrev
606 dist = -1 * dist
607
608 for x in xrange(startrev, endrev, dist):
599 609 r.revision(r.node(x))
600 610
601 611 timer(d)
General Comments 0
You need to be logged in to leave comments. Login now