Re: stat very inefficient

From: Chris Wedgwood
Date: Wed Jul 28 2004 - 19:29:26 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/