[MLton-devel] MLton and profiling

Joe Hurd MLton@mlton.org
Sat, 8 Feb 2003 18:36:35 +0000 (GMT)


On Fri, 31 Jan 2003, Stephen Weeks wrote:

> We would be grateful for any feedback you could provide on this
> version of MLton, and especially on the new features, since we are
> planning to do a public release soon.

I have now had a chance to play with version 20030130, and have a few
comments about my experience with Metis in this new environment.

I had a bit of trouble getting Metis to compile, even with the
invaluable -basis 1997 flag, which I eventually tracked down to a
piece of library code like the following:

local
  open Word;
in
  val i = ~(Word.toIntX 0w0);
end

I have no idea why it was written like this, but it doesn't compile
with MLton 20030130, and it did with the one I was using before (two
public releases back, I think: why doesn't MLton support a --version
flag?). If you remove the "open Word;" line in the above code, it
does compile.

Once I'd sorted that out, I was able to compile Metis, and have
spent many happy hours playing with the new profiling system. In
general, I love it, but I have one small complaint with the
otherwise-wonderful call-graphs. My problem is functions like:

function composition;
fun ## (f,g) (x,y) = (f x, g y);
fun total f x = SOME (f x) handle ERR _ => NONE;

They all show up on the call graph as hugely important, with large
numbers of called and caller functions, but I use these functions like
simple macros to inline. [Sometimes just to improve the layout of code
on the page: (f o g o h o j) x versus f (g (h (j x))).] I'm rather
horrified at the thought that MLton might be treating them as
functions instead of inlining them, but even if so I'd still like a
way of suppressing them in the call graph.

Considering the function

fun f n = (g o h) n;

I believe at the moment this would be represented as a call from f to
o, and a call from o to g and h. I'd much prefer this to be treated as
a call from f to g and h. After all, I could insist on this simply by
tweaking the code to be

fun f n = g (h n);

This is obviously a completely trivial example, but I hope you see my
point.

Overall, a great version for me. Performance tuning on Metis will
certainly involve much less guesswork in the future.

Cheers,

Joe




-------------------------------------------------------
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