Subject: Re: locate(1) (was Re: CVS commit: basesrc)
To: None <cgd@netbsd.org, enami@sm.sony.co.jp>
From: Noriyuki Soda <soda@sra.co.jp>
List: tech-userlevel
Date: 03/09/2000 02:43:46
> enami tsugutomo <enami@sm.sony.co.jp> writes:
> > I guess the question is how much of memory comsumed by making find to
> > sort, and guess that not so much as temprary storage used by sort,
> > since the comparison is done in each directory component.
> 
> Uh, but before outputting anything from 'find,' you'd still have to
> have all records in memory before you could output any of them.

Hmmm...
I think the needed memory depends on a directory size which has 
maximum number of entries, and depends on depth of directory tree,
but doesn't depend on whole size of directory tree. Since only
one directory per hierarchical level is needed to output sorted
tree. Isn't it?
i.e. Total (in-core + on-disk) memory cost by sort command is
O(total_file_number), but the cost by find command may be almost
O(directory_depth).
Although I haven't checked acutall sources.
--
soda