From patchwork Tue May 23 14:04:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,3] perfphases: add 'perfphases' command From: Pierre-Yves David X-Patchwork-Id: 20864 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Tue, 23 May 2017 16:04:21 +0200 # HG changeset patch # User Pierre-Yves David # 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. 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() +@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