contrib/perf.py
changeset 30977 5a9e4dc8e4fd
parent 30975 22fbca1d11ed
child 31397 8f5ed8fa39f8
--- a/contrib/perf.py	Wed Feb 15 13:17:45 2017 -0800
+++ b/contrib/perf.py	Wed Feb 15 13:07:26 2017 -0800
@@ -1269,6 +1269,17 @@
         timer(fn, title=title)
         fm.end()
 
+@command('perfwrite', formatteropts)
+def perfwrite(ui, repo, **opts):
+    """microbenchmark ui.write
+    """
+    timer, fm = gettimer(ui, opts)
+    def write():
+        for i in range(100000):
+            ui.write(('Testing write performance\n'))
+    timer(write)
+    fm.end()
+
 def uisetup(ui):
     if (util.safehasattr(cmdutil, 'openrevlog') and
         not util.safehasattr(commands, 'debugrevlogopts')):