From: Chris Gehlker Date: 2002-06-15T11:51:21+09:00 Subject: Re: Are Unix tools just slow? On 6/14/02 3:34 PM, "Rick Bradley" wrote: > * Chris Gehlker (gehlker@fastq.com) [020614 17:18]: >> On this old box, >> sudo find / > /dev/null >> Takes 61 seconds so I don't have any hope of avoiding the C code. > > How long would you expect an enumeration of the names of every file and > directory visible on the system to take? Depends on whether you are walking the directory tree or just scanning raw file system information. > (Note that the fact that you are redirecting stdout to /dev/null in your > shell session is not apparent to find(1) so it can't do the obvious > optimization.) Redirecting was just to avoid cluttering up the timing with screen issues. >> It got me wondering, though. Are the unix file inquiry tools just really >> slow on Mac OSX or are they slow everywhere? > > To my experience (I'm not an OS/X user) the unix command-line tools are > not slow; though that statement predicates knowledge regarding the use > of the right tool for the task at hand [0]. "Slow" as in "takes an amount of time perceptible to the user." >> Did Unix sacrifice efficiency for portability? I've learned of list that some other *nixen have optimized equivalents of find but they are always called something other than 'find'. To follow up on an idea suggested in the previous thread, maybe Ruby should have a 'scan' or something similar that behaves like find but uses the fast form if it's available. Scan could also be mixed into Dir. Any interest? -- Cogito Ergo Spud. - I think therefore I yam.