Jim Meyering <[EMAIL PROTECTED]> wrote:
> Bruno Haible <[EMAIL PROTECTED]> wrote:
>> Jim Meyering wrote:
>>> I'll use 180.
>>> The lower we go, the more of a performance penalty
>>> we impose for directories with very many entries.
>>
>> I tried the value 180. It worked fine in some cases, but still failed in
>> others:
> ...
>> Thus, instead of testing whether the number of directory entries since the
>> last rewind() exceeds a fixed number, a better test is probably whether
>>
>>     (total length of file names since last rewind()
>>      + 10 * number of directory entries since last rewind())
>>     > a fixed number such as 3000
>
> Thanks for the quick test and analysis!
> Considering all of that, I may just keep the code simple
> and make rm always do an extra rewind on Darwin.

FYI, decreasing that constant all the way to 1
(be as conservative as possible) has relatively
little impact on performance.  In the worst case,
a deep and narrow hierarchy, I see a performance
decrease of only 8%.


Reply via email to