This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/__init__.py b/__init__.py | |
index 4515650..14140b2 100644 | |
--- a/__init__.py | |
+++ b/__init__.py | |
@@ -125,6 +125,7 @@ import enum | |
from . import _compiler, _parser | |
import functools | |
import _sre | |
+import sys | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Speed up os.walk() significantly by using file attributes that | |
FindFirst/Next give us instead of doing an extra stat(). Can also do the same | |
thing with opendir/readdir on Linux. | |
This is doubly useful when the user (caller of os.walk) is doing *another* | |
stat() to get say the file sizes. | |
On my tests (Windows 64-bit) our walk() is about 5x as fast as os.walk() for | |
large directory trees, and 9x as fast if you're doing the file size thing. | |
Note that these timings are "once it's in the cache", not first-time timings. |