[Checkins] SVN: Products.CMFCore/branches/2.2/Products/CMFCore/ Fix slow debug-mode performance on Windows. Previous commit was the
Ross Patterson
me at rpatterson.net
Tue Mar 6 20:43:29 UTC 2012
Log message for revision 124530:
Fix slow debug-mode performance on Windows. Previous commit was the
wrong merge.
Merge trunk at 120180:
- improved debug mode speed on NTFS partitions
Changed:
U Products.CMFCore/branches/2.2/Products/CMFCore/CHANGES.txt
U Products.CMFCore/branches/2.2/Products/CMFCore/DirectoryView.py
-=-
Modified: Products.CMFCore/branches/2.2/Products/CMFCore/CHANGES.txt
===================================================================
--- Products.CMFCore/branches/2.2/Products/CMFCore/CHANGES.txt 2012-03-06 19:16:10 UTC (rev 124529)
+++ Products.CMFCore/branches/2.2/Products/CMFCore/CHANGES.txt 2012-03-06 20:43:27 UTC (rev 124530)
@@ -6,8 +6,11 @@
- Avoid a shallow dependency on `Products.ZReST`. (Merged [122078])
-- Fix slow debug-mode performance on Windows. (Merged [120174])
- [rossp]
+- DirectoryView: Improved debug mode speed on NTFS partitions. The
+ much faster non-Windows implementation is now used on Windows as
+ well if non-FAT32 time stamps are detected. In rare cases that
+ heuristic approach might fail to detected NTFS partitions.
+ (Merged [120174])
2.2.5 (2011-11-01)
Modified: Products.CMFCore/branches/2.2/Products/CMFCore/DirectoryView.py
===================================================================
--- Products.CMFCore/branches/2.2/Products/CMFCore/DirectoryView.py 2012-03-06 19:16:10 UTC (rev 124529)
+++ Products.CMFCore/branches/2.2/Products/CMFCore/DirectoryView.py 2012-03-06 20:43:27 UTC (rev 124530)
@@ -112,8 +112,13 @@
self._reg_key = reg_key
self.ignore = base_ignore + tuple(ignore)
if platform == 'win32':
- self.use_dir_mtime = False
- self._walker = _walker(self.ignore)
+ try:
+ ntfs_detected = bool(os.stat(self._filepath).st_mtime % 1)
+ except OSError:
+ ntfs_detected = False
+ if not ntfs_detected:
+ self.use_dir_mtime = False
+ self._walker = _walker(self.ignore)
subdirs = []
for entry in _filtered_listdir(self._filepath, ignore=self.ignore):
entry_filepath = os.path.join(self._filepath, entry)
More information about the checkins
mailing list