Date: Sun, 25 Jan 2004 16:08:18 -0800 From: Kris Kennaway <kris@obsecurity.org> To: ports@FreeBSD.org Subject: Recursive make speedup patch Message-ID: <20040126000817.GA33860@xor.obsecurity.org>
next in thread | raw e-mail | index | archive | help
--gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. * I tried using make -jX to build the INDEX in parallel, but I ended up with overlapping output from the child makes and a corrupted INDEX. There should be some way to make it work. * 'make index' and 'make describe' use some perl code, which might be optimized or rewritten (e.g. replaced by an awk script, which would have the further benefit of working out of the box on 5.x). I have not yet tried a port build with these patches - I'd be most concerned about the bsd.gnome.mk inclusion change. Please let me know if you run into any problems. Kris --gKMricLos+KVdGMg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAFFpxWry0BWjoQKURAtleAJ4oJVv8XmZv4U6NemosID1ep1DIpgCg31Ge FAhxxnmh3TFiP7LtYvAyi/Y= =aqZP -----END PGP SIGNATURE----- --gKMricLos+KVdGMg--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040126000817.GA33860>