Mercurial > hg
changeset 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 |
files | contrib/perf.py |
diffstat | 1 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Wed Nov 21 12:02:25 2018 +0000 +++ b/contrib/perf.py Wed Nov 21 22:56:06 2018 +0100 @@ -2325,17 +2325,18 @@ msg = b'benchmark of branchmap with %d revisions with %d new ones\n' ui.status(msg % (len(allbaserevs), len(newrevs))) - base = branchmap.branchcache() - base.update(repo, allbaserevs) - - def setup(): - x[0] = base.copy() + if True: + base = branchmap.branchcache() + base.update(repo, allbaserevs) - def bench(): - x[0].update(repo, newrevs) + def setup(): + x[0] = base.copy() - timer(bench, setup=setup) - fm.end() + def bench(): + x[0].update(repo, newrevs) + + timer(bench, setup=setup) + fm.end() @command(b'perfbranchmapload', [ (b'f', b'filter', b'', b'Specify repoview filter'),