[PATCH 1 of 3] perfphases: add 'perfphases' command

Gregory Szorc gregory.szorc at gmail.com
Fri May 26 12:58:36 EDT 2017


On Tue, May 23, 2017 at 7:04 AM, Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at octobus.net>
> # Date 1495498987 -7200
> #      Tue May 23 02:23:07 2017 +0200
> # Node ID e7b7317363359a4bb15b5713ff034c6fd2008339
> # Parent  e8c043375b53b30c4b468687f08323cbeeb452ef
> # EXP-Topic perf
> # Available At https://www.mercurial-scm.org/
> repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/
> repo/users/marmoute/mercurial/ -r e7b731736335
> perfphases: add 'perfphases' command
>
> This commands benchmark the time spend computing the data in a repository.
>

I queued this patch.


>
> diff --git a/contrib/perf.py b/contrib/perf.py
> --- a/contrib/perf.py
> +++ b/contrib/perf.py
> @@ -581,6 +581,17 @@ def perfpathcopies(ui, repo, rev1, rev2,
>      timer(d)
>      fm.end()
>
> + at command('perfphases', [], "")
> +def perfphases(ui, repo, **opts):
> +    """benchmark phasesets computation"""
> +    timer, fm = gettimer(ui, opts)
> +    phases = repo._phasecache
> +    def d():
> +        phases.invalidate()
> +        phases.loadphaserevs(repo)
> +    timer(d)
> +    fm.end()
> +
>  @command('perfmanifest', [], 'REV')
>  def perfmanifest(ui, repo, rev, **opts):
>      timer, fm = gettimer(ui, opts)
> diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t
> --- a/tests/test-contrib-perf.t
> +++ b/tests/test-contrib-perf.t
> @@ -93,6 +93,7 @@ perfstatus
>     perfparents   (no help text available)
>     perfpathcopies
>                   (no help text available)
> +   perfphases    benchmark phasesets computation
>     perfrawfiles  (no help text available)
>     perfrevlog    Benchmark reading a series of revisions from a revlog.
>     perfrevlogchunks
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170526/cd0ae1f1/attachment.html>


More information about the Mercurial-devel mailing list