From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20110117183601.567225B04@mail.bitblocks.com> References: <20110117165024.CC7C75B04@mail.bitblocks.com> <20110117183601.567225B04@mail.bitblocks.com> Date: Mon, 17 Jan 2011 21:33:31 +0200 Message-ID: From: Ciprian Dorin Craciun To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] `mk` (from Plan9 ports) efficiency related issue Topicbox-Message-UUID: 9da8e144-ead6-11e9-9d60-3106f5b1d025 On Mon, Jan 17, 2011 at 20:36, Bakul Shah wrote= : > On Mon, 17 Jan 2011 11:56:22 EST erik quanstrom =C2=A0wrote: >> > strace tells you what system calls were made and when. =C2=A0To >> > find out which functions use most time, compile with -pg and >> > look at the gprof output once done. =C2=A0That 14 seconds were >> > probably spent computing dependencies. =C2=A0You can convert your >> > test.mk to a Makefile with a trivial sed script. See what >> > bsdmake or gmake does with it time wise. {bsd,g}make have >> > been been abused with huge Makefiles for far longer and are >> > likely to be friendlier to them :-) > >> i don't see how comparing with *make would get one closer >> to solving the mystery. > > The comparison would reveal if other makes do better. I > suspect they do and that would solve Ciprian's problem. Ok. So I've transformed (with a `sed` script as suggested) the script from `mk` to GNU `make. The results is as follows: * building the entire thing with no parallelism took as in my experiment -- when I've just obtained the raw commands and runned them with plain sh -- about 1 minute and 27 seconds seconds; * after the build issuing `make` a second time take under one second (0.2 seconds); I'll try now to profile the `mk` tool as suggested. Ciprian. P.S.: I'm not suggesting that GNU `make` is a better tool, just that for this particular task it behaves better. (Actually I find it overly complex and almost incomprehensible in its full implications...)