Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Jun 2004 16:17:36 +0200
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        ports@FreeBSD.org
Subject:   Re: INDEX patch
Message-ID:  <40BDE180.90709@fillmore-labs.com>
In-Reply-To: <20040602135625.GA56115@xor.obsecurity.org>
References:  <20040602121648.GA51625@xor.obsecurity.org> <40BDCC4B.9000708@fillmore-labs.com> <20040602132149.GA55452@xor.obsecurity.org> <40BDD8B6.80103@fillmore-labs.com> <20040602134340.GA55881@xor.obsecurity.org> <40BDDB39.9090106@fillmore-labs.com> <20040602135625.GA56115@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Kris Kennaway wrote:

> On Wed, Jun 02, 2004 at 03:50:49PM +0200, Oliver Eikemeier wrote:
> 
> 
>>>>Because test is a sh-builtin, and the file system should cache this 
>>>>information
>>>>I don't expect to see any difference. Especially since spawning perl 
>>>>11000 times
>>>>is more than suboptimal ;) You didn't mean this serious, did you?
>>>
>>>I did, because I care about small pessimizations of the INDEX build.
>>>Sometimes they're not small.  Did you benchmark it?
>>
>>No. Did you? 
> 
> I did, actually.  Removing the ECHO_CMD is a small but measurable
> improvement

The backquote removal should be accountable for the difference. Try
to remove an other ECHO_CMD - it shouldn't bring the same benefits.
When it does, move try moving them inside the perl expression.

> (and not negligible when the total index build time is
> only 120 seconds, which I've achieved with other optimizations).

Sigh. I guess I'm lacking the iron to benchmark modifications that fast,
so you wouldn't see any tests from me.

> This
> is a silly argument though, because you just need to test for the
> existence of perl once in /usr/ports/Makefile.

... which does not help when I choose to run `make describe' inside a
ports directory. Actually this is recommended in the FreeBSD Porter's
Handbook, 14.1: Running make describe.

Generally, we should have targets in bsd.port.mk that either just work
(possibly producing an error message), or move stuff out of bsd.port.mk
into external scripts. We already have too many useless hacks in there.

>>Honestly, when you really want to improve INDEX building times, it
>>should be worth thinking about not spawning perl every time, but instead do 
>>the
>>substitutions in batch. I my experience microoptimization on the expense of
>>clarity and prudence almost always result in highly optimized suboptimal
>>algorithms that together run far slower that they have to.
> 
> This sounds like a good idea for future improvement.  Can you take a
> look at implementing it?

When I find the time. Currently I started a rewrite of the distfile handling
code, as a follow-up to PR 63933 and PR 64157:
  <http://people.freebsd.org/~eik/patches/distfiles/>;
which has the potential to improve INDEX build times too, by removing more than
just one test (or echo). Maybe you can benchmark this too?

-Oliver



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40BDE180.90709>