[MLton-devel] Re: MLton and profiling

Stephen Weeks MLton@mlton.org
Tue, 11 Feb 2003 08:23:55 -0800


Thanks for the feedback Andreas.

> One thing that confused me, though, was the treatment of curried 
> functions. They appear multiple times in the profiling output (e.g. with 
> test runs of Hamlet I got up to 20 instances of Type.clone). The user's 
> guide seems to be silent on this (apart from mentionining functors), so 
> I'm not sure what to make of it.

Yes, that was a change that went in between 20030130 and 20030209.  I
figured it was better to keep track of copies of a function that the
implementation creates.  There's nothing specific to currying.  It's
really just dependent on whatever
monomorphisation/polyvariance/inlining happens.  In any case, the user
guide now has the following paragraph.

  {\mlton}'s optimizer may duplicate source functions for any of a
  number of reasons.  By default, each of these duplicates is treated
  as a different function for the purposes of profiling.  It you would
  like all of the copies of a function to be treated as one, you can
  compile the program with {\tt -profile-combine true}.  Even with
  this, copies of a function that arise from functor duplication are
  still kept separate.

> BTW, I would love to apply profiling to parts of the Alice system (which 
> really needs it...). Unfortunately, it makes heavy use of extensions 
> like or patterns and vector expressions. Is there any chance that MLton 
> will support them in the future?

It's very unlikely.  I have a pretty strong opinion that lack of
portability caused by compilers not following the standard is a
serious problem with SML.  I'd much rather encourage you to make Alice
standard.  Perhaps the profiler will be just the right push :-).


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel