Comments
Patch
@@ -1568,11 +1568,13 @@ def perfvolatilesets(ui, repo, *names, *
('', 'clear-revbranch', False,
'purge the revbranch cache between computation'),
] + formatteropts)
-def perfbranchmap(ui, repo, full=False, clear_revbranch=False, **opts):
+def perfbranchmap(ui, repo, *filternames, **opts):
"""benchmark the update of a branchmap
This benchmarks the full repo.branchmap() call with read and write disabled
"""
+ full = opts.get("full", False)
+ clear_revbranch = opts.get("clear_revbranch", False)
timer, fm = gettimer(ui, opts)
def getbranchmap(filtername):
"""generate a benchmark function for the filtername"""
@@ -1591,6 +1593,9 @@ def perfbranchmap(ui, repo, full=False,
return d
# add filter in smaller subset to bigger subset
possiblefilters = set(repoview.filtertable)
+ print("FILTERNAMES", filternames)
+ if filternames:
+ possiblefilters &= set(filternames)
subsettable = getbranchmapsubsettable()
allfilters = []
while possiblefilters:
@@ -1607,8 +1612,9 @@ def perfbranchmap(ui, repo, full=False,
if not full:
for name in allfilters:
repo.filtered(name).branchmap()
- # add unfiltered
- allfilters.append(None)
+ if not filternames or 'unfiltered' in filternames:
+ # add unfiltered
+ allfilters.append(None)
branchcacheread = safeattrsetter(branchmap, 'read')
branchcachewrite = safeattrsetter(branchmap.branchcache, 'write')