Mercurial > hg
changeset 27493:14b0930105da
perf: make start revision configurable for perfrevlog
This will help isolate performance characteristics of delta chains.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 20 Dec 2015 19:56:23 -0800 |
parents | ac549d7fbc2b |
children | cc87d2c01ea5 |
files | contrib/perf.py |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Sun Dec 20 19:45:55 2015 -0800 +++ b/contrib/perf.py Sun Dec 20 19:56:23 2015 -0800 @@ -475,20 +475,23 @@ fm.end() @command('perfrevlog', revlogopts + formatteropts + - [('d', 'dist', 100, 'distance between the revisions')], + [('d', 'dist', 100, 'distance between the revisions'), + ('s', 'startrev', 0, 'revision to start reading at')], '-c|-m|FILE') -def perfrevlog(ui, repo, file_=None, **opts): +def perfrevlog(ui, repo, file_=None, startrev=0, **opts): """Benchmark reading a series of revisions from a revlog. By default, we read every ``-d/--dist`` revision from 0 to tip of the specified revlog. + + The start revision can be defined via ``-s/--startrev``. """ timer, fm = gettimer(ui, opts) dist = opts['dist'] _len = getlen(ui) def d(): r = cmdutil.openrevlog(repo, 'perfrevlog', file_, opts) - for x in xrange(0, _len(r), dist): + for x in xrange(startrev, _len(r), dist): r.revision(r.node(x)) timer(d)