Patchwork [3,of,6] perf: call clearcaches() in perfmanifest

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 21, 2015, 4:04 a.m.
Message ID <972ebaece5fa6718cbf8.1450670651@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/12198/
State Accepted
Headers show

Comments

Gregory Szorc - Dec. 21, 2015, 4:04 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1450663064 28800
#      Sun Dec 20 17:57:44 2015 -0800
# Node ID 972ebaece5fa6718cbf844100f983292524588ca
# Parent  795c9f3f2a6b917abe040303390f31cca3a4984d
perf: call clearcaches() in perfmanifest

The old code only partially cleared the caches. Now that we have a
comprehensive method for wiping all caches, let's call it.

This appears to introduce a marginal regression in `hg perfmanifest`
on mozilla-central. This is good because the new result is more
accurate since caches aren't being used.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -268,18 +268,17 @@  def perfpathcopies(ui, repo, rev1, rev2,
     fm.end()
 
 @command('perfmanifest', [], 'REV')
 def perfmanifest(ui, repo, rev, **opts):
     timer, fm = gettimer(ui, opts)
     ctx = scmutil.revsingle(repo, rev, rev)
     t = ctx.manifestnode()
     def d():
-        repo.manifest._mancache.clear()
-        repo.manifest._cache = None
+        repo.manifest.clearcaches()
         repo.manifest.read(t)
     timer(d)
     fm.end()
 
 @command('perfchangeset', formatteropts)
 def perfchangeset(ui, repo, rev, **opts):
     timer, fm = gettimer(ui, opts)
     n = repo[rev].node()