changeset 17592:64c6a0d4d4bd

store: optimize fncache._write by direncoding the contents in one go For a netbeans clone on Windows 7 x64: Before: $ hg perffncachewrite ! wall 0.210000 comb 0.218401 user 0.202801 sys 0.015600 (best of 47) After: $ hg perffncachewrite ! wall 0.104000 comb 0.109201 user 0.078000 sys 0.031200 (best of 95)
author Adrian Buehlmann <adrian@cadifra.com>
date Mon, 17 Sep 2012 08:58:35 +0200
parents 9a5c2ecd1158
children 9e31a72bede7
files mercurial/store.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/store.py	Sun Sep 16 11:41:02 2012 +0200
+++ b/mercurial/store.py	Mon Sep 17 08:58:35 2012 +0200
@@ -348,7 +348,7 @@
     def _write(self, files, atomictemp):
         fp = self.opener('fncache', mode='wb', atomictemp=atomictemp)
         if files:
-            fp.write('\n'.join(map(encodedir, files)) + '\n')
+            fp.write(encodedir('\n'.join(files) + '\n'))
         fp.close()
         self._dirty = False