Patchwork [1,of,3] perf: use the same timer for all section of perfrevlogrevision

login
register
mail settings
Submitter Boris Feld
Date Nov. 6, 2018, 10:34 a.m.
Message ID <92466f201ed80783a2e1.1541500461@Laptop-Boris.lan>
Download mbox | patch
Permalink /patch/36412/
State Accepted
Headers show

Comments

Boris Feld - Nov. 6, 2018, 10:34 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1541499211 -3600
#      Tue Nov 06 11:13:31 2018 +0100
# Node ID 92466f201ed80783a2e1d37ad4fd1ff80df1f36a
# Parent  c2a0bc6412dbbcbba20517e250b0fcd2fc79b0e7
# EXP-Topic sparse-prefrevlogrevision
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 92466f201ed8
perf: use the same timer for all section of perfrevlogrevision

Otherwise the -T json output is invalid.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -1790,10 +1790,10 @@  def perfrevlogrevision(ui, repo, file_, 
         (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.'),