Posted Mar 19, 2010 14:00 UTC (Fri) by nix (subscriber, #2304)
[Link]
Uh, the syscall underlying readdir() (getdents()) reads a whole bunch of entries at once, so you don't need 3000 syscalls to readdir() through 3000 names. If you want to stat() them, then you're right: but all you need to do in this case is get their names, which is much faster.