Shachar Shemesh wrote: > >While you're there, one little trick I've found that speeds up > >scanning large directory hierarchies is to stat() or open() entries in > >inode-number order. For some filesystems it makes no difference, but > >for others it reduces the average disk seek time as on many common > >filesystems, inode number is related to position on the disk. In > >unusual cases I've seen a factor of 10 improvement, but usually it's > >just 1-2. > > > The way I see it, if you got that far, then you don't have any problem > with the size of the file list.
I don't mean to stat() after reading the whole hierarchy! That doesn't make sense anyway, because you have to stat() to decide if something's a directory in order to recurse into it. I mean one directory at a time, after calling readdir(), just sort the list of directory entries by d_ino values before using them. That's negligable in time and memory. -- Jamie -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html