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).
--- 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: