changeset 18241:f5ed27c51995

perftest: allow selection of volatile set to benchmark This helps when you focus on a subset of the volatile chain.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Fri, 04 Jan 2013 19:24:32 +0100
parents a8318715d8bb
children e4687edec014
files contrib/perf.py
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)