[2] [gclist] GC & profiling

Fergus Henderson fjh@cs.mu.oz.au
Tue, 24 Apr 2001 04:13:26 +1000


On 23-Apr-2001, eliot@parcplace.com <eliot@parcplace.com> wrote:
> Fergus Henderson <fjh@cs.mu.oz.au>:
> | On 19-Apr-2001, eliot@parcplace.com <eliot@parcplace.com> wrote:
> | > Fergus Henderson <fjh@cs.mu.oz.au>:
> | > | For accurate profiling of execution time, GC can cause some problems,
> | > | because GCs can occur at semi-random times, but the blame for time spent
> | > | in a GC should really be spread among all the routines that allocated
> | > | the memory, not on the routine that happened to do the final memory
> | > | allocation which triggered that GC.
> | > 
> | > I'm not sure if this is the best way iof solving it, but it is an alternative
> | > approach.  The VisualWorks Smalltalk profiling facilities provide both a time
> | > profiler and an allocation profiler.  The time profiler doesn't include
> | > explicit GC time.  Instead it is simply a statistical sampler of Smalltalk
> | > methods, so GC time is hidden.
> 
> | I'm not sure what you mean by that.
> | Do you mean that
> | 	- if a profiling timer tick occurs during GC, that tick is discarded?
> | 	- if a profiling timer tick occurs during GC, that tick is credited to
> | 	  the currently active Smalltalk method?
> | 	  (This is what happens in the current Mercury profiler.)
> | 	- profiling ticks can never occur during GC (e.g. because the
> | 	  profiler actually counts number of bytecode instructions executed,
> | 	  rather than time)?
> | 	- something else?
> 
> Option 2,  if a profiling timer tick occurs during GC, that tick is credited
> to the currently active Smalltalk method, which means GC costs are effectively
> hidden.

OK, so it sounds like you're doing the same kind of thing as in the current
Mercury profiler, with the same potential for misleading results.

It's nice to know from Nick Barnes' post that the Harlequin MLWorks
profiler got this right.  But since Harlequin went out of business,
I'm not sure what that tells us :-(  Perhaps the only thing to be learnt
from this is another one of those depressing worse-is-better lessons:
maybe the problem is just not sufficiently important in practice to
be worth worrying about.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.