Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jan 2004 01:22:31 +0100
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        ports@FreeBSD.org
Subject:   Re: Recursive make speedup patch
Message-ID:  <40145DC7.2040602@fillmore-labs.com>
In-Reply-To: <20040126000817.GA33860@xor.obsecurity.org>
References:  <20040126000817.GA33860@xor.obsecurity.org>

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

> The patch available at
> 
>   http://people.freebsd.org/~kris/recursive-speedup.patch
> 
> gives a 43% speedup for 'make index' in my testing:
> 
> No optimization
> 1899.40 real       648.67 user      1148.96 sys
> 
> Optimized version
> 1096.76 real       504.48 user       565.90 sys
> 
> The optimizations I used were:
> 
> * Don't unconditionally include <bsd.gnome.mk> twice for every port;
> only do so if the port defines USE_GNOME or WANT_GNOME.  I had to
> modify a couple of ports to make this work, and I'm not 100% certain
> there are no unintended side-effects.
> 
> * Pass down some more variables from bsd.port.subdir.mk instead of
> assigning them by forking a shell to evaluate a command in each child
> makefile.
> 
> * Don't invoke perl just to print a string in 'make describe'
> 
> * Use make transformation magic instead of invoking 'basename' in a
> shell.
> 
> There are some more things that could be looked at, but they're more
> difficult and the benefits are unknown:
> 
> * A lot of the variable assignments in bsd.port.mk (e.g. CONFIGURE
> stuff) are not necessary for recursive targets like 'make describe'.
> They could be hidden behind a conditional and avoided unless we're
> actually doing a port build.  I'm not sure how expensive these are
> though, so it may not be worth it.

How about the following:

Create a bsd.ports.mk.cache that caches all variables that are unlikely
to change (like PORTOBJFORMAT) saving at least some spawned processes?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40145DC7.2040602>