[Python-ideas] BetterWalk, a better and faster os.walk() for Python

Ben Hoyt benhoyt at gmail.com
Thu Nov 22 23:43:59 CET 2012


> I tested on OS X 10.8.2 on a Retina MBP 15" with 16GB and the stock SSD, using
> Apple 2.6 and 2.7 and python.org 3.3. It seems to be a bit slower in 2.x, a bit
> faster in 3.x, more so in 32-bit mode, and better without -s. The best result I
> got anywhere was 1.5x (3.3, 32-bit, no -s), but repeating that test gave
> anywhere from 1.2x to 1.5x.

Yeah, that's about what I'm seeing on Linux and OS X. (Though for some
weird reason I'm seeing 10x as fast on OS X when I do "python
benchmark.py /usr" -- hence my comments in the README.)

Anyway, thanks for the benchmarks, guys. I'm satisfied with the
Windows results. But I'll need to rewrite the Linux version in C (to
match os.listdir) before these results are really meaningful.

-Ben



More information about the Python-ideas mailing list