perftest: allow selection of volatile set to benchmark
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 04 Jan 2013 19:24:32 +0100
changeset 18241 f5ed27c51995
parent 18240 a8318715d8bb
child 18242 e4687edec014
perftest: allow selection of volatile set to benchmark This helps when you focus on a subset of the volatile chain.
contrib/perf.py
--- a/contrib/perf.py	Fri Jan 04 19:23:26 2013 +0100
+++ b/contrib/perf.py	Fri Jan 04 19:24:32 2013 +0100
@@ -278,7 +278,7 @@
     timer(d)
 
 @command('perfvolatilesets')
-def perfvolatilesets(ui, repo):
+def perfvolatilesets(ui, repo, *names):
     """benchmark the computation of various volatile set
 
     Volatile set computes element related to filtering and obsolescence."""
@@ -290,7 +290,11 @@
             obsolete.getrevs(repo, name)
         return d
 
-    for name in sorted(obsolete.cachefuncs):
+    allobs = sorted(obsolete.cachefuncs)
+    if names:
+        allobs = [n for n in allobs if n in names]
+
+    for name in allobs:
         timer(getobs(name), title=name)
 
     def getfiltered(name):
@@ -299,5 +303,9 @@
             repoview.filteredrevs(repo, name)
         return d
 
-    for name in sorted(repoview.filtertable):
+    allfilter = sorted(repoview.filtertable)
+    if names:
+        allfilter = [n for n in allfilter if n in names]
+
+    for name in allfilter:
         timer(getfiltered(name), title=name)