perf: add a command to test addremove performance
authorSiddharth Agarwal <sid0@fb.com>
Mon, 01 Apr 2013 23:09:36 -0700
changeset 18871 a2d4ab4f575d
parent 18869 e8b4b139a545
child 18872 16b34391819d
perf: add a command to test addremove performance Upcoming patches will improve addremove performance. This command will be used to demonstrate that improvement.
contrib/perf.py
--- a/contrib/perf.py	Wed Apr 03 11:35:27 2013 -0700
+++ b/contrib/perf.py	Mon Apr 01 23:09:36 2013 -0700
@@ -54,6 +54,15 @@
     #                                                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'):