comparison contrib/perf.py @ 40769:95f35c873463

perf: pre-indent some code in `perfbranchmapupdate` This make the next patch easier to read.
author Boris Feld <boris.feld@octobus.net>
date Wed, 21 Nov 2018 22:56:06 +0100
parents f723014677a5
children b059388d976c
comparison
equal deleted inserted replaced
40768:f723014677a5 40769:95f35c873463
2323 newrevs.sort() 2323 newrevs.sort()
2324 2324
2325 msg = b'benchmark of branchmap with %d revisions with %d new ones\n' 2325 msg = b'benchmark of branchmap with %d revisions with %d new ones\n'
2326 ui.status(msg % (len(allbaserevs), len(newrevs))) 2326 ui.status(msg % (len(allbaserevs), len(newrevs)))
2327 2327
2328 base = branchmap.branchcache() 2328 if True:
2329 base.update(repo, allbaserevs) 2329 base = branchmap.branchcache()
2330 2330 base.update(repo, allbaserevs)
2331 def setup(): 2331
2332 x[0] = base.copy() 2332 def setup():
2333 2333 x[0] = base.copy()
2334 def bench(): 2334
2335 x[0].update(repo, newrevs) 2335 def bench():
2336 2336 x[0].update(repo, newrevs)
2337 timer(bench, setup=setup) 2337
2338 fm.end() 2338 timer(bench, setup=setup)
2339 fm.end()
2339 2340
2340 @command(b'perfbranchmapload', [ 2341 @command(b'perfbranchmapload', [
2341 (b'f', b'filter', b'', b'Specify repoview filter'), 2342 (b'f', b'filter', b'', b'Specify repoview filter'),
2342 (b'', b'list', False, b'List brachmap filter caches'), 2343 (b'', b'list', False, b'List brachmap filter caches'),
2343 (b'', b'clear-revlogs', False, b'refresh changelog and manifest'), 2344 (b'', b'clear-revlogs', False, b'refresh changelog and manifest'),