perfbranchmap: add an option to purge the revbranch cache
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 05 Jun 2017 16:24:01 +0100
changeset 32710 326c0e2c1a1d
parent 32709 16ada4cbb1a9
child 32711 04c19c808241
perfbranchmap: add an option to purge the revbranch cache The perf extension needs to be able to reflect this reality too. (eg: 4s vs 60s on a Million-ish revisions repository).
contrib/perf.py
--- a/contrib/perf.py	Mon May 29 05:53:58 2017 +0200
+++ b/contrib/perf.py	Mon Jun 05 16:24:01 2017 +0100
@@ -1309,8 +1309,10 @@
 @command('perfbranchmap',
          [('f', 'full', False,
            'Includes build time of subset'),
+          ('', 'clear-revbranch', False,
+           'purge the revbranch cache between computation'),
          ] + formatteropts)
-def perfbranchmap(ui, repo, full=False, **opts):
+def perfbranchmap(ui, repo, full=False, clear_revbranch=False, **opts):
     """benchmark the update of a branchmap
 
     This benchmarks the full repo.branchmap() call with read and write disabled
@@ -1323,6 +1325,8 @@
         else:
             view = repo.filtered(filtername)
         def d():
+            if clear_revbranch:
+                repo.revbranchcache()._clear()
             if full:
                 view._branchcaches.clear()
             else: