[PATCH] perf: add perffncacheencode

Adrian Buehlmann adrian at cadifra.com
Fri Sep 14 06:12:38 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1347620551 -7200
# Node ID 7ec8d214d9752f82f26c19229b9955225f7770f4
# Parent  fc1a5d0eb3bbb1116051b65dcd2873389f9d7ed4
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.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -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, []),


More information about the Mercurial-devel mailing list