# HG changeset patch # User Pierre-Yves David # Date 2017-05-23 00:23:07 # Node ID ad37c569ec8121a99e4cd9da52365b114b82e744 # Parent 12e241b2713ce44897c0bd19e8e16163b1b5d6e7 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