perfphases: add 'perfphases' command
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 23 May 2017 02:23:07 +0200
changeset 32467 ad37c569ec81
parent 32466 12e241b2713c
child 32468 4c4d91908492
perfphases: add 'perfphases' command This commands benchmark the time spend computing the data in a repository.
contrib/perf.py
tests/test-contrib-perf.t
--- a/contrib/perf.py	Tue May 16 22:15:42 2017 -0700
+++ b/contrib/perf.py	Tue May 23 02:23:07 2017 +0200
@@ -581,6 +581,17 @@
     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)
--- a/tests/test-contrib-perf.t	Tue May 16 22:15:42 2017 -0700
+++ b/tests/test-contrib-perf.t	Tue May 23 02:23:07 2017 +0200
@@ -93,6 +93,7 @@
    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