perf: use the same timer for all section of perfrevlogrevision
authorBoris Feld <boris.feld@octobus.net>
Tue, 06 Nov 2018 11:13:31 +0100
changeset 40529 cf3bef7f162b
parent 40528 520514af2d93
child 40530 914079ee3334
perf: use the same timer for all section of perfrevlogrevision Otherwise the -T json output is invalid.
contrib/perf.py
--- a/contrib/perf.py	Tue May 22 15:26:17 2018 +0200
+++ b/contrib/perf.py	Tue Nov 06 11:13:31 2018 +0100
@@ -1790,10 +1790,10 @@
         (lambda: dohash(text), b'hash'),
     ]
 
+    timer, fm = gettimer(ui, opts)
     for fn, title in benches:
-        timer, fm = gettimer(ui, opts)
         timer(fn, title=title)
-        fm.end()
+    fm.end()
 
 @command(b'perfrevset',
          [(b'C', b'clear', False, b'clear volatile cache between each call.'),