changeset 22782:a1eb21f5caea

dirstate: cache util.normcase while constructing the foldmap This is a small win on OS X. hg perfdirstatefoldmap: before: wall 0.399708 comb 0.410000 user 0.390000 sys 0.020000 (best of 25) after: wall 0.386331 comb 0.390000 user 0.370000 sys 0.020000 (best of 25)
author Siddharth Agarwal <sid0@fb.com>
date Fri, 03 Oct 2014 18:48:09 -0700
parents 70624fda193d
children 524b786bd54f
files mercurial/dirstate.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Fri Oct 03 18:47:28 2014 -0700
+++ b/mercurial/dirstate.py	Fri Oct 03 18:48:09 2014 -0700
@@ -84,11 +84,12 @@
     @propertycache
     def _foldmap(self):
         f = {}
+        normcase = util.normcase
         for name, s in self._map.iteritems():
             if s[0] != 'r':
-                f[util.normcase(name)] = name
+                f[normcase(name)] = name
         for name in self._dirs:
-            f[util.normcase(name)] = name
+            f[normcase(name)] = name
         f['.'] = '.' # prevents useless util.fspath() invocation
         return f