[PATCH 2 of 2] perf: add an option to profile the benchmark section

Yuya Nishihara yuya at tcha.org
Wed May 22 19:21:42 EDT 2019


On Wed, 22 May 2019 16:46:11 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at octobus.net>
> # Date 1558445208 -7200
> #      Tue May 21 15:26:48 2019 +0200
> # Node ID b5c316b4248f3add425313ac0f443c8888706b79
> # Parent  8553423d79608bd5d144456448509bdf98c6df11
> # EXP-Topic perf-profile
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r b5c316b4248f
> perf: add an option to profile the benchmark section

Queued, thanks.

> @@ -389,8 +414,9 @@ def _timer(fm, func, setup=None, title=N
>      while keepgoing:
>          if setup is not None:
>              setup()
> -        with timeone() as item:
> -            r = func()
> +        with profiler:
> +            with timeone() as item:
> +                r = func()

Is it okay to enter/exit to the same profiler more than once?


More information about the Mercurial-devel mailing list