In comp.unix.solaris
reb@cypress.com wrote:
> What script language did you use?
> Looks like some shells (csh and tcsh?) in some circumstances at least,
> after each chdir will stat() each parent dir on up the hier. Thus each
> shell chdir command from depth N to N+1 will cost one chdir() and N+1
> stat() calls; and individual steps down to a deep depth by separate
> chdirs will incur an exponential number of stat() calls.
> The experience of the other responses suggest perl and sh likely never
> produce similar behavior, so probably you are safe to just stick to one
> of those. I don't know the purpose in the csh's of doing this, nor if
> there's a way to avoid it.
When I was testing this on a Solaris 8 U10, my main problem with shell
scripts wasn't any stat stuff on chdirs, but just the slowness of forks
necessary to invoke the various utilities. Running the previous
poster's shell solution for popping the top directory off and removing
it would remove about 2500 directories a minute on the test box. (That
solution also doesn't use any chdir() calls). C and Perl rewrites of
the same thing both removed about 33K directories a minute. I don't
know if the HP forks would be any lighter weight or not.
--
Darren Dunham
ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >