perf: add perffncacheencode
Examples (all done with somewhat dated clones I found on my disk):
Netbeans (~120k entries in fncache):
$ hg perffncacheencode
! wall 4.338000 comb 4.336828 user 4.336828 sys 0.000000 (best of 3)
Openoffice (~77k entries in fncache)):
$ hg perffncacheencode
! wall 1.533000 comb 1.528810 user 1.528810 sys 0.000000 (best of 7)
Xen (~10k entries in fncache):
$ hg perffncacheencode
! wall 0.198000 comb 0.187201 user 0.187201 sys 0.000000 (best of 51)
Done on Windows 7 x64.
--- a/contrib/perf.py Thu Sep 13 17:00:56 2012 -0700
+++ b/contrib/perf.py Fri Sep 14 13:02:31 2012 +0200
@@ -195,6 +195,16 @@
s.fncache.write()
timer(d)
+def perffncacheencode(ui, repo):
+ from mercurial import store
+ s = store.store(set(['store','fncache','dotencode']),
+ repo.path, scmutil.opener)
+ s.fncache._load()
+ def d():
+ for p in s.fncache.entries:
+ s.encode(p)
+ timer(d)
+
def perfdiffwd(ui, repo):
"""Profile diff of working directory changes"""
options = {
@@ -226,6 +236,7 @@
'perfcca': (perfcca, []),
'perffncacheload': (perffncacheload, []),
'perffncachewrite': (perffncachewrite, []),
+ 'perffncacheencode': (perffncacheencode, []),
'perflookup': (perflookup, []),
'perfrevrange': (perfrevrange, []),
'perfnodelookup': (perfnodelookup, []),