Mercurial > hg-stable
changeset 40721:4369c00a8ee1
perf: move some of the perftags benchmark to the setup function
Creating fresh objects and clearing the cache should not be part of the
timing.
before: ! wall 0.020851 comb 0.020000 user 0.020000 sys 0.000000 (median of 138)
after: ! wall 0.018740 comb 0.020000 user 0.020000 sys 0.000000 (median of 141)
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 20 Nov 2018 10:10:25 +0000 |
parents | c0a1686d9391 |
children | d7936a9dad47 |
files | contrib/perf.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Mon Nov 19 23:14:46 2018 +0000 +++ b/contrib/perf.py Tue Nov 20 10:10:25 2018 +0000 @@ -537,14 +537,15 @@ timer, fm = gettimer(ui, opts) svfs = getsvfs(repo) repocleartagscache = repocleartagscachefunc(repo) - def t(): + def s(): repo.changelog = mercurial.changelog.changelog(svfs) rootmanifest = mercurial.manifest.manifestrevlog(svfs) repo.manifestlog = mercurial.manifest.manifestlog(svfs, repo, rootmanifest) repocleartagscache() + def t(): return len(repo.tags()) - timer(t) + timer(t, setup=s) fm.end() @command(b'perfancestors', formatteropts)