Re: stat very inefficient

Chris Wedgwood
2004-07-29T00:25:14Z

On Wed, Jul 28, 2004 at 05:14:14PM -0700, David S. Miller wrote:

> Run "time find . -type f" on the kernel tree, both before and
> after removing the third unnecessary copy. Many machines sit all
> day and stat files.

On an old crappy ia32 machine:

cw@taniwha:~/wk/linux/cw-current$ time find . -noleaf | wc
42372 42372 1549653

real 0m0.188s
user 0m0.042s
sys 0m0.146s

that 0.2s to make almost 50K stat64 calls (if you strace and grep you
can see that count).

Since I have to do something with that data (ie. build a kernel) and
that's *probably* going to take many seconds, even making the stat
overhead 0 wouldn't put much of dent into the overall time.

What am I missing?

--cw