changeset 41436:ab6d1f82be32

perf: move cache clearing in the `setup` step of `perfheads` The cache clearing is pretty fast, but this seems more "correct".
author Boris Feld <boris.feld@octobus.net>
date Fri, 25 Jan 2019 14:53:19 -0500
parents e2e815e3c4ae
children d65ba1ff4559
files contrib/perf.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Fri Jan 25 18:22:02 2019 -0500
+++ b/contrib/perf.py	Fri Jan 25 14:53:19 2019 -0500
@@ -539,10 +539,11 @@
     opts = _byteskwargs(opts)
     timer, fm = gettimer(ui, opts)
     cl = repo.changelog
+    def s():
+        clearcaches(cl)
     def d():
         len(cl.headrevs())
-        clearcaches(cl)
-    timer(d)
+    timer(d, setup=s)
     fm.end()
 
 @command(b'perftags', formatteropts+