I doubt that `os.walk` will be slower than `os.listdir`, it uses the same top-down recursive approach. And readability is better. IMO using `os.listdir` would be premature optimization if you don't already know that it will be faster.

I tried to measure it but it's pretty hard because there seems to be some caching going on. The first time I walked my music folder it took 5.5 seconds, the following times it was down to 1.8 to 2 seconds.

A possibility to speed up things is mentioned here: http://stackoverflow.com/a/4739544/284318 But it's filesystem specific.