Patchwork [1,of,2] perf: add a command to measure revset performance

login
register
mail settings
Submitter Siddharth Agarwal
Date Dec. 7, 2012, 6:56 p.m.
Message ID <3d2dd6342dcd106626fb.1354906619@sid0x220>
Download mbox | patch
Permalink /patch/29/
State Accepted
Commit 1471f5e83686107c8ebbbec47d05d3fbda40959f
Headers show

Comments

Siddharth Agarwal - Dec. 7, 2012, 6:56 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1354821671 28800
# Node ID 3d2dd6342dcd106626fb3b19048cab03a59f6296
# Parent  f0da340980832986e8c69551b294f63bb29099e0
perf: add a command to measure revset performance

Patch

diff -r f0da34098083 -r 3d2dd6342dcd contrib/perf.py
--- a/contrib/perf.py	Wed Dec 05 14:33:15 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")
 }