Mercurial > hg
changeset 24349:389693a245fa
perf: add methods for timing changeset file list reading
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 18 Mar 2015 12:03:44 -0500 |
parents | b7f936f47f2b |
children | 7002ad149f30 |
files | contrib/perf.py |
diffstat | 1 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Sun Mar 15 21:52:35 2015 -0400 +++ b/contrib/perf.py Wed Mar 18 12:03:44 2015 -0500 @@ -293,6 +293,25 @@ timer(d) fm.end() +@command('perfctxfiles') +def perfparents(ui, repo, x): + x = int(x) + timer, fm = gettimer(ui) + def d(): + len(repo[x].files()) + timer(d) + fm.end() + +@command('perfrawfiles') +def perfparents(ui, repo, x): + x = int(x) + timer, fm = gettimer(ui) + cl = repo.changelog + def d(): + len(cl.read(x)[3]) + timer(d) + fm.end() + @command('perflookup') def perflookup(ui, repo, rev): timer, fm = gettimer(ui)