Re: stat very inefficient

Ulrich Drepper
2004-07-29T01:11:51Z

David S. Miller wrote:

> "find . -type f" is probably the most often run command somewhere
> in a shell pipeline [...]

I hope you're testing this on a recent system with a good find
implementation. Nowadays find calls stat for this command line only for
directories and symlinks. Those types along with normal files are all
known to find through the readdir calls (i.e., the d_type field).

Check your strace output to see whether your system is recent enough.

--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖