##// END OF EJS Templates
perfbranchmap: allow to select the filter to benchmark...
Boris Feld -
r36380:c25290b9 default
parent child Browse files
Show More
@@ -1568,11 +1568,13 b' def perfvolatilesets(ui, repo, *names, *'
1568 ('', 'clear-revbranch', False,
1568 ('', 'clear-revbranch', False,
1569 'purge the revbranch cache between computation'),
1569 'purge the revbranch cache between computation'),
1570 ] + formatteropts)
1570 ] + formatteropts)
1571 def perfbranchmap(ui, repo, full=False, clear_revbranch=False, **opts):
1571 def perfbranchmap(ui, repo, *filternames, **opts):
1572 """benchmark the update of a branchmap
1572 """benchmark the update of a branchmap
1573
1573
1574 This benchmarks the full repo.branchmap() call with read and write disabled
1574 This benchmarks the full repo.branchmap() call with read and write disabled
1575 """
1575 """
1576 full = opts.get("full", False)
1577 clear_revbranch = opts.get("clear_revbranch", False)
1576 timer, fm = gettimer(ui, opts)
1578 timer, fm = gettimer(ui, opts)
1577 def getbranchmap(filtername):
1579 def getbranchmap(filtername):
1578 """generate a benchmark function for the filtername"""
1580 """generate a benchmark function for the filtername"""
@@ -1591,6 +1593,8 b' def perfbranchmap(ui, repo, full=False, '
1591 return d
1593 return d
1592 # add filter in smaller subset to bigger subset
1594 # add filter in smaller subset to bigger subset
1593 possiblefilters = set(repoview.filtertable)
1595 possiblefilters = set(repoview.filtertable)
1596 if filternames:
1597 possiblefilters &= set(filternames)
1594 subsettable = getbranchmapsubsettable()
1598 subsettable = getbranchmapsubsettable()
1595 allfilters = []
1599 allfilters = []
1596 while possiblefilters:
1600 while possiblefilters:
@@ -1607,8 +1611,9 b' def perfbranchmap(ui, repo, full=False, '
1607 if not full:
1611 if not full:
1608 for name in allfilters:
1612 for name in allfilters:
1609 repo.filtered(name).branchmap()
1613 repo.filtered(name).branchmap()
1610 # add unfiltered
1614 if not filternames or 'unfiltered' in filternames:
1611 allfilters.append(None)
1615 # add unfiltered
1616 allfilters.append(None)
1612
1617
1613 branchcacheread = safeattrsetter(branchmap, 'read')
1618 branchcacheread = safeattrsetter(branchmap, 'read')
1614 branchcachewrite = safeattrsetter(branchmap.branchcache, 'write')
1619 branchcachewrite = safeattrsetter(branchmap.branchcache, 'write')
General Comments 0
You need to be logged in to leave comments. Login now