[Asterisk-Users] New sounds also now in CVS

Robert Hajime Lanning lanning+asterisk at monsoonwind.com
Mon Jan 19 19:37:38 MST 2004


<quote who="Tilghman Lesher">
> Although the OS may cache that information, the userland process
> can take quite some time to process a very full directory.  I've had
> this happen quite a few times with Linux ext2 filesystems, where the
> fileglob * exceeded bash's limit of 32,768 characters.  /bin/ls on
> those directories took several minutes before the first results were
> given.
>
> I'll additionally comment that the directories I was working with were
> not normally that full, but was a side effect of a process dumping
> lots of little files into a directory when something went wrong.
>
> On a slight tangent, NT4 had a practical limit of about 300 directory
> entries before attempting to process the directory became unbearably
> slow.
>
> -Tilghman

A couple of things, searching a directory for a specific name tends to be
a linear search through the directory (unless the filesystem uses binary
trees, like ReiserFS...), "ls" is a bad example of a command, it is more of
a worse case example.

ls will read the entire directory, sort it, then do a stat() on every file
listed.  All of this is done before it formats the output.  So, you have to
wait until it is all done, before you see the first character output.

-- 
END OF LINE
       -MCP



More information about the asterisk-users mailing list