[Python-ideas] Speed up os.walk() 5x to 9x by using file attributes from FindFirst/NextFile() and readdir()

Serhiy Storchaka storchaka at gmail.com
Fri Nov 9 23:56:47 CET 2012


On 09.11.12 22:30, Vinay Sajip wrote:
> Sounds good. I recently answered a Stack Overflow question [1] which showed
> Python performing an order of magnitude slower than Ruby. Ruby's Dir
> implementation is written in C and less flexible than os.walk, but there's room
> for improvement, as you've shown.

This is not so much about walking, as about recursive globbing.  See http://bugs.python.org/issue13968.

Also note that os.fwalk can be must faster than os.walk (if OS supports it).




More information about the Python-ideas mailing list