# HG changeset patch # User Matt Mackall # Date 2015-03-18 17:03:44 # Node ID 389693a245fa399abbd993f0ebc12bd3be75b411 # Parent b7f936f47f2b104a60840bae571e009742126afc perf: add methods for timing changeset file list reading diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -293,6 +293,25 @@ def perfparents(ui, repo): 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)