From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Mon, 17 Jan 2011 11:56:22 EST." References: <20110117165024.CC7C75B04@mail.bitblocks.com> From: Bakul Shah Date: Mon, 17 Jan 2011 10:36:01 -0800 Message-Id: <20110117183601.567225B04@mail.bitblocks.com> Subject: Re: [9fans] `mk` (from Plan9 ports) efficiency related issue Topicbox-Message-UUID: 9d8b8748-ead6-11e9-9d60-3106f5b1d025 On Mon, 17 Jan 2011 11:56:22 EST erik quanstrom wrote: > > strace tells you what system calls were made and when. To > > find out which functions use most time, compile with -pg and > > look at the gprof output once done. That 14 seconds were > > probably spent computing dependencies. You 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 :-) > > why not just use prof, which is exactly the tool for the job? Ciprian specified plan9ports. Recipe for building a profiling mk on unix: cd $PLAN9/src/cmd/mk 9 mk clean CC9="gcc -pg" 9 mk all Then: mk=$PLAN9/src/cmd/mk/o.mk cd 9 mk clean 9 $mk gproff $mk > mk.gprof This will show where time is being spent. > 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.