[PATCH 1 of 2] perf: time fncache read and write performance
Bryan O'Sullivan
bos at serpentine.com
Thu Apr 12 17:22:08 CDT 2012
# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1334269312 25200
# Node ID 524152bfd147d5375a3692a35698857b92c8c6f5
# Parent 0353b99ba459ac80bb71388a49118d0336f66855
perf: time fncache read and write performance
diff -r 0353b99ba459 -r 524152bfd147 contrib/perf.py
--- a/contrib/perf.py Thu Apr 12 14:45:24 2012 -0700
+++ b/contrib/perf.py Thu Apr 12 15:21:52 2012 -0700
@@ -157,6 +157,22 @@
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 = {
@@ -186,6 +202,8 @@
cmdtable = {
'perfcca': (perfcca, []),
+ 'perffncacheload': (perffncacheload, []),
+ 'perffncachewrite': (perffncachewrite, []),
'perflookup': (perflookup, []),
'perfnodelookup': (perfnodelookup, []),
'perfparents': (perfparents, []),
More information about the Mercurial-devel
mailing list