# HG changeset patch # User Brodie Rao # Date 2013-11-17 23:04:28 # Node ID 74aea4be8e780566eb16977d240608b50200814e # Parent c5f0574034ef3304b4834312f1e651f321d0516a perf: add perfmoonwalk command to walk the changelog backwards This lets us test the effectiveness (or ineffectiveness) of the revlog chunk cache when walking revlogs backwards. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -243,6 +243,18 @@ def perflog(ui, repo, **opts): copies=opts.get('rename'))) ui.popbuffer() +@command('perfmoonwalk') +def perfmoonwalk(ui, repo): + """benchmark walking the changelog backwards + + This also loads the changelog data for each revision in the changelog. + """ + def moonwalk(): + for i in xrange(len(repo), -1, -1): + ctx = repo[i] + ctx.branch() # read changelog data (in addition to the index) + timer(moonwalk) + @command('perftemplating') def perftemplating(ui, repo): ui.pushbuffer()