OK, riddle me this...
I have a directory with 64,000 files in it. They're all zero-
length regular files in an ext2 filesystem on a SCSI hard drive, nothing
unusual. But check this:
chindi:/tmp/manyfiles$ time ls
(snip list of file)
real 7m37.655s
user 0m2.640s
sys 6m20.450s
Ouch! That's /slow/. Let's see why it's slow:
chindi:/tmp/manyfiles$ strace -c ls
(snip)
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
85.15 0.321233 50 6400 write
13.65 0.051490 107 482 getdents
0.44 0.001653 8 217 brk
(snip)
------ ----------- ----------- --------- --------- ----------------
100.00 0.377256 7380 2 total
0.4 SECONDS?! Something is obviously very different here, but
what? Amusingly enough, the strace manpage says "A traced process runs
slowly"...
JDW
--
If mail to me bounces, try removing the "+STRING" part.