[MLton] Question on profile.fun

Wesley W. Terpstra wesley@terpstra.ca
Fri, 3 Jun 2005 15:25:49 +0200

On Fri, Jun 03, 2005 at 08:11:03AM -0400, Matthew Fluet wrote:
> > If you are using the move of a constant value into a gc variable, why do you
> > still need to keep the profiling mark data? It seems to me this is an unfair
> > comparison. Right now, those extra labels prevent some optimization, right?
> Correct.  There is another experiment to be done where labels are not 
> inserted into the Machine IL code.

I am quite puzzled by why the presence of a label inhibits optimizations.
What kind of things does it prevent MLton from doing? Common subexpression
elimination, or what? Or can you not replicate labels (thus meaning less
inlining...)? Just curious.

> > If you put in a 'mov' at the profiling entry point _instead_ of a label,
> > that may incur entirely different penalties than a label and a mov...?
> Different, but I doubt entirely different.  If you compare
>   -profile alloc -profile-dummy false
> with
>   -profile alloc -profile-dummy true
> you see the same overheads.  And alloc profiling doesn't need extra labels 
> (though, it does add other code, which may interfere, but probably not 
> much).

Ahh. In that case I will keep my ignorant mouth shut. :-)

Wesley W. Terpstra