list.sort(func) speed

Michael Peuser mpeuser at web.de
Sun Aug 31 09:22:21 EDT 2003


"Peter Otten" <__peter__ at web.de> schrieb im Newsbeitrag
news:bisoke$ql$01$1 at news.t-online.com...

> You recommend win32api.FindFiles in the old thread, which is non-portable
> but definitely not a "self made scheme". I have to admit the numbers are
> striking. Wild guess: time is burnt reading directories rather than
> processing file name strings. Anyway, standard Python seems to have room
> for improvement in the area :-(
>
One has to be flexible.... I recall a program change I made some weeks ago,
where I changed os.path.splitext(x) into  x[:-4] because I knew the
extension of the some 2000 filenames I wanted to display on a Tk widget.
This improves  display time from 1,3  to 0,7 secs.

Kindly
Michael P






More information about the Python-list mailing list