profiling mutator time per function vs. GC time

Janis Voigtlaender
Fri, 08 Nov 2002 11:10:44 +0100


I want to profile a program, to find out:

 a) the time spent in expression evaluation per function (mutator time)

 b) the amount of garbage collection caused by the whole program

It seems I have two options:

 A) compile without profiling support and run the compiled program with
    +RTS -sstderr

 B) compile with profiling support -prof -auto-all and run the compiled
    program with +RTS -p -sstderr

In case A, I get a good measure of GC vs. mutator time, but I don't know
the amount of time used by single functions, so I can't seperate between
mutator time spent in the functions that really interest me and the time
spent for the test frame.

In case B, I can seperate mutator time spent in single functions, but I
have the impression that the GC time I then get includes the GC for the
profiler, and hence is useless for me, because different GC times for
different algorithms might just mean that one of the algorithms requires
more profiling overhead.

Is this impression correct? 

If so, then it seems I can't obtain all the information about my program
that I want, except there is an option C, of which I don't know?

Any hints welcome,

Janis Voigtlaender