On Mon, 17 Jan 2011 11:56:22 EST erik quanstrom <quans...@labs.coraid.com>  
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 <source dir>
    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.

Reply via email to