[PATCH 1 of 3] perf: add perfmoonwalk command to walk the changelog backwards

Augie Fackler raf at durin42.com
Sun Nov 17 16:08:41 CST 2013


On Sun, Nov 17, 2013 at 02:51:43PM -0500, Brodie Rao wrote:
> # HG changeset patch
> # User Brodie Rao <brodie at sf.io>
> # Date 1384713197 18000
> #      Sun Nov 17 13:33:17 2013 -0500
> # Node ID cd18bc43b89a33f321b2025b4e7e32c8f33f4614
> # Parent  c38c3fdc8b9317ba09e03ab09364c3800da7c50c
> 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,14 @@ def perflog(ui, repo, **opts):
>                                 copies=opts.get('rename')))
>      ui.popbuffer()
>
> + at command('perfmoonwalk')
> +def perfmoonwalk(ui, repo):

Name is clever and mpm likes it, but it at least needs a docstring
about what it's doing so future self doesn't forget what it does.

> +    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()
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list