[PATCH] store: optimize fncache._load a bit by dirdecoding the contents in one go

Adrian Buehlmann adrian at cadifra.com
Mon Sep 17 04:54:43 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1347872438 -7200
# Node ID a08bf97d98dc91f58c966bf50b69b25b8594d4cb
# Parent  e3593b976379bb4d41ecf8ee5f94cae5b05e8e26
store: optimize fncache._load a bit by dirdecoding the contents in one go

For a netbeans clone on Windows 7 x64:

  Before:
    $ hg perffncacheload
    ! wall 0.124000 comb 0.124801 user 0.124801 sys 0.000000 (best of 76)

  After:
    $ hg perffncacheload
    ! wall 0.096000 comb 0.093601 user 0.078001 sys 0.015600 (best of 97)

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -336,7 +336,7 @@
             # skip nonexistent file
             self.entries = set()
             return
-        self.entries = set(map(decodedir, fp.read().splitlines()))
+        self.entries = set(decodedir(fp.read()).splitlines())
         if '' in self.entries:
             fp.seek(0)
             for n, line in enumerate(fp):


More information about the Mercurial-devel mailing list