From owner-freebsd-ports@FreeBSD.ORG Sun Jan 25 16:22:36 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5FCA716A4CE for ; Sun, 25 Jan 2004 16:22:36 -0800 (PST) Received: from postman.arcor.de (postman2.arcor-online.net [151.189.0.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7751943D31 for ; Sun, 25 Jan 2004 16:22:34 -0800 (PST) (envelope-from eikemeier@fillmore-labs.com) Received: from fillmore.dyndns.org (port-212-202-51-21.reverse.qsc.de [212.202.51.21]) (authenticated bits=0)i0Q0MWgG004455 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 26 Jan 2004 01:22:32 +0100 (MET) Received: from [172.16.0.2] (helo=fillmore-labs.com) by fillmore.dyndns.org with esmtp (Exim 4.30; FreeBSD) id 1AkuWN-000OXT-UQ; Mon, 26 Jan 2004 01:22:31 +0100 Message-ID: <40145DC7.2040602@fillmore-labs.com> Date: Mon, 26 Jan 2004 01:22:31 +0100 From: Oliver Eikemeier Organization: Fillmore Labs GmbH - http://www.fillmore-labs.com/ MIME-Version: 1.0 To: Kris Kennaway References: <20040126000817.GA33860@xor.obsecurity.org> In-Reply-To: <20040126000817.GA33860@xor.obsecurity.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit User-Agent: KMail/1.5.9 cc: ports@FreeBSD.org Subject: Re: Recursive make speedup patch X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2004 00:22:36 -0000 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 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?