# HG changeset patch # User Pierre-Yves David # Date 2017-06-05 15:24:01 # Node ID 326c0e2c1a1d59e07f4c9d86f81e4419c3d779d8 # Parent 16ada4cbb1a9407ec906333d9096ad57b67a7c90 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). diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -1309,8 +1309,10 @@ def perfvolatilesets(ui, repo, *names, * @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 @@ def perfbranchmap(ui, repo, full=False, else: view = repo.filtered(filtername) def d(): + if clear_revbranch: + repo.revbranchcache()._clear() if full: view._branchcaches.clear() else: