Mercurial > public > mercurial-scm > hg-stable
diff contrib/perf.py @ 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 | 37a92908a382 |
children | f5b527024fcc |
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)