# HG changeset patch # User Siddharth Agarwal # Date 2012-12-06 19:21:11 # Node ID 1471f5e83686107c8ebbbec47d05d3fbda40959f # Parent 0e4316c3a70389b4ff318fac1f2416535a370ff5 perf: add a command to measure revset performance diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -228,6 +228,11 @@ def perfrevlog(ui, repo, file_, **opts): timer(d) +def perfrevset(ui, repo, expr): + def d(): + repo.revs(expr) + timer(d) + cmdtable = { 'perfcca': (perfcca, []), 'perffncacheload': (perffncacheload, []), @@ -258,4 +263,5 @@ cmdtable = { 'perfrevlog': (perfrevlog, [('d', 'dist', 100, 'distance between the revisions')], "[INDEXFILE]"), + 'perfrevset': (perfrevset, [], "REVSET") }