Patchwork [1,of,6,V2] perf: add a command to test addremove performance

login
register
mail settings
Submitter Siddharth Agarwal
Date April 2, 2013, 9:52 p.m.
Message ID <d723353c8a0ab2ced860.1364939573@sid0x220>
Download mbox | patch
Permalink /patch/1247/
State Accepted
Commit a2d4ab4f575d98ef675be7f1f1f34359c58d1e1e
Headers show

Comments

Siddharth Agarwal - April 2, 2013, 9:52 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1364882976 25200
#      Mon Apr 01 23:09:36 2013 -0700
# Node ID d723353c8a0ab2ced8606014abee43aa0b1e3fa4
# Parent  4335ea327027234ef72e2a342fb163be15ce6007
perf: add a command to test addremove performance

Upcoming patches will improve addremove performance. This command will be used
to demonstrate that improvement.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -54,6 +54,15 @@  def perfstatus(ui, repo, **opts):
     #                                                False))))
     timer(lambda: sum(map(len, repo.status(**opts))))
 
+@command('perfaddremove')
+def perfaddremove(ui, repo):
+    try:
+        oldquiet = repo.ui.quiet
+        repo.ui.quiet = True
+        timer(lambda: scmutil.addremove(repo, dry_run=True))
+    finally:
+        repo.ui.quiet = oldquiet
+
 def clearcaches(cl):
     # behave somewhat consistently across internal API changes
     if util.safehasattr(cl, 'clearcaches'):