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

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 14 21:55:27 CET 2012


Mike Meyer wrote:
> 
> On Nov 14, 2012 4:55 AM, "Antoine Pitrou" <solipsis at pitrou.net 
> <mailto:solipsis at pitrou.net>> wrote:
>  >
>  > This assumes directory entries are sorted by inode number
> 
> It doesn't assume that, because inodes aren't stored in directories on 
> Posix file systems.

It seems to assume that the inodes referenced by a particular
directory will often be clustered, so that many of them reside
in the same or nearby disk blocks. But it's hard to imagine this
having much effect with the large file system caches used these
days.

-- 
Greg



More information about the Python-ideas mailing list