os.path.walk (was: Re: Optimizing code)

François Pinard pinard at iro.umontreal.ca
Sat Feb 26 17:01:55 CET 2000


"Thomas A. Bryan" <tbryan at python.net> écrit:
> François Pinard wrote:

> > Or course, I could reprogram os.path.walk for my things.  I thought it
> > would have been nice if the standard walk in Python was behaving the best
> > it could, depending on the system it runs on.  When a Python script walks
> > the structure of a disk, this is often where most of the time is spent,
> > and for big file hierarchies, this time can become quite significant.

> I'm sure that a lot of us would be interested in any optimizations in
> os.path.walk or os.stat.  If you're interested enough to develop a patch,
> then we could pound on it until all the bugs are gone.  Then you could
> propse the feature to Guido again with a patch in hand. :)

In fact, I rewrote os.path.walk soon after having sent the message (in
a rush, as I really supposed to be doing other things in these days :-).
Initial testing did not bring me the speed gains I was expecting, that is,
not enough to be worth a change.  But I'll rather suspect my testing than
my code, you surely know how presumptuous programmers usually are :-).
In any case, I'm putting this rewrite on hold for now, with the intention
of revisiting it later, for when I will have more free time before me!

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list