perftest: allow selection of volatile set to benchmark
This helps when you focus on a subset of the volatile chain.
--- 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)