perf: add a command to measure revset performance
authorSiddharth Agarwal <sid0@fb.com>
Thu, 06 Dec 2012 11:21:11 -0800
changeset 18062 1471f5e83686
parent 18061 0e4316c3a703
child 18063 34a1a639d835
perf: add a command to measure revset performance
contrib/perf.py
--- a/contrib/perf.py	Wed Dec 12 15:17:18 2012 -0800
+++ b/contrib/perf.py	Thu Dec 06 11:21:11 2012 -0800
@@ -228,6 +228,11 @@
 
     timer(d)
 
+def perfrevset(ui, repo, expr):
+    def d():
+        repo.revs(expr)
+    timer(d)
+
 cmdtable = {
     'perfcca': (perfcca, []),
     'perffncacheload': (perffncacheload, []),
@@ -258,4 +263,5 @@
     'perfrevlog': (perfrevlog,
                    [('d', 'dist', 100, 'distance between the revisions')],
                    "[INDEXFILE]"),
+    'perfrevset': (perfrevset, [], "REVSET")
 }