[issue25596] Use scandir() to speed the glob module
Serhiy Storchaka
report at bugs.python.org
Mon Jan 11 07:18:20 EST 2016
Serhiy Storchaka added the comment:
Results of microbenchmarks for glob_scandir_4.patch:
$ ./python -m timeit -s "from glob import glob" -- "glob('**/*', recursive=True)"
Unpatched: 275 msec per loop
Patched: 79.4 msec per loop
$ ./python -m timeit -s "from glob import glob" -- "glob('/usr/lib*/**/*', recursive=True)"
Unpatched: 2.11 sec per loop
Patched: 624 msec per loop
$ ./python -m timeit -s "from glob import glob" -- "glob('/usr/lib*/**/', recursive=True)"
Unpatched: 1.79 sec per loop
Patched: 281 msec per loop
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25596>
_______________________________________
More information about the Python-bugs-list
mailing list