changeset 40579:cf3bef7f162b

perf: use the same timer for all section of perfrevlogrevision Otherwise the -T json output is invalid.
author Boris Feld <boris.feld@octobus.net>
date Tue, 06 Nov 2018 11:13:31 +0100
parents 520514af2d93
children 914079ee3334
files contrib/perf.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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.'),