[MLton] Question on profile.fun

Wesley W. Terpstra wesley@terpstra.ca
Wed, 1 Jun 2005 18:29:42 +0200


On Wed, Jun 01, 2005 at 12:02:29PM -0400, Matthew Fluet wrote:
> Finally, and much to the chagrin of those wanting to map source code onto 
> assembly code, I wonder if we can't simplify time profiling by associating 
> a  currentSourceSeq  field in the gc state and having  profile.fun  
> explicitly change the field as appropriate when time profiling.  This 
> would appear to simplify the time profiling, as we wouldn't need to 
> inspect the PC state, figure out how to grab begin and end of text 
> segment, etc.  That ought to make it easier for new platforms to support 
> time profiling.

I think this is a nice idea.
It also eliminates that gigantic profiling lookup table. =)

Of course, there is the problem that this will impact the program's
performance and make time profiling less useful.... OTOH, the profiling
function pointer probably always be cached, so maybe it is fast enough.

-- 
Wesley W. Terpstra