Mk/bsd.openssl.mk optimization

Doug Barton dougb at FreeBSD.org
Mon Aug 4 18:28:23 UTC 2008


V.Chukharev wrote:
> On Mon, 04 Aug 2008 09:20:04 +0300, Doug Barton <dougb at freebsd.org> wrote:
> 
>> Vladimir Chukharev wrote:
>>> On Tue, 29 Jul 2008 23:13:44 +0300, Doug Barton <dougb at freebsd.org>
>>> wrote:
>>>
>>>> V.Chukharev wrote:
>>>>> Another patch, just one line. It can be applied independently
>>>>> from the patch for bsd.port.subdir.mk.
>>>> I use: grep -l "@comment ORIGIN:${1}$" $pdb/*/+CONTENTS for
>>>> similar purposes in portmaster with no complaints so far. Is
>>>> there a reason you need to do the complicated thing?
>>> I am a bit worried by the size of * expansion.
>> I'm starting to wonder if you've actually tested and/or benchmarked
> 
> Not very deeply, you are right.

Well that's a relief to know that my "perception of reality" filter 
isn't totally out of whack. :)

  >> this stuff. I've run tests of the construction above for 5,000
>> directories which is way more ports than a user would ever have
>> installed. Rerunning this contrived example:
> 
> Ok, that means that the limit is between 5000 and 6721:
> 
> $ ls /var/db/pkg/*/+* 

You're still comparing apples and oranges. The correct command to test 
what we're trying to improve would be 'ls /var/db/pkg/*/+CONTENTS'. 
Remember that there are at least 4 and sometimes 5 files in each pkg 
directory.

Again in my contrived example, /home/dougb/testglob/*/file works with 
8,426 directories, fails with 8,427. I think that's more than enough 
safety margin for the forseeable future, and if the system ever 
exploded to the point that any user had more than 8,426 ports 
installed the stuff can always be fixed. :)

In any case I do agree that getting rid of grep -r is a noble goal, 
I'm glad that you looked into this.

Doug

-- 

     This .signature sanitized for your protection



More information about the freebsd-ports mailing list