# HG changeset patch # User Pierre-Yves David # Date 2013-01-04 18:24:32 # Node ID f5ed27c51995c2f145b1a1f3226fc2a13ef559b5 # Parent a8318715d8bb6c473f0178a942402dbad586b6cb perftest: allow selection of volatile set to benchmark This helps when you focus on a subset of the volatile chain. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -278,7 +278,7 @@ def perfrevset(ui, repo, expr, clear=Fal 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 @@ def perfvolatilesets(ui, repo): 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 @@ def perfvolatilesets(ui, repo): 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)