# HG changeset patch # User Bryan O'Sullivan # Date 2012-04-12 22:21:52 # Node ID efae1fea4bbded6ca1ae10345c0469e07c9b610c # Parent 1fb2f1400ea88f9d55f48c85afe47f20ed500a98 perf: time fncache read and write performance diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -136,6 +136,22 @@ def perftemplating(ui, repo): def perfcca(ui, repo): timer(lambda: scmutil.casecollisionauditor(ui, False, repo[None])) +def perffncacheload(ui, repo): + from mercurial import scmutil, store + s = store.store(set(['store','fncache']), repo.path, scmutil.opener) + def d(): + s.fncache._load() + timer(d) + +def perffncachewrite(ui, repo): + from mercurial import scmutil, store + s = store.store(set(['store','fncache']), repo.path, scmutil.opener) + s.fncache._load() + def d(): + s.fncache._dirty = True + s.fncache.write() + timer(d) + def perfdiffwd(ui, repo): """Profile diff of working directory changes""" options = { @@ -165,6 +181,8 @@ def perfrevlog(ui, repo, file_, **opts): cmdtable = { 'perfcca': (perfcca, []), + 'perffncacheload': (perffncacheload, []), + 'perffncachewrite': (perffncachewrite, []), 'perflookup': (perflookup, []), 'perfnodelookup': (perfnodelookup, []), 'perfparents': (perfparents, []),