mlprof is right (I think) (but I have improvements)

Stephen Weeks sweeks@wasabi.epr.com
Fri, 9 Jul 1999 20:28:36 -0700 (PDT)


These results, if true, are stunning.  They imply that in doing a
self-compile, MLton is spending 74% of its running time in C overhead
(mostly in MLTON_gc, which does the copying back and forth of
pointers) and 21% of its time in garbage collection, and is still
running almost twice as fast as SML/NJ.  They also imply that we can
get a factor of 4 speedup with a native code compiler (by losing the
74% C overhead), and at that point, we will be spending 80% of our
time in GC, which would imply that we should be able to get at least
another factor of 2 by improving the GC (or just using more memory).
I.E. we're talking a factor of at least 8 speedup here, giving a
factor of 16 over SML/NJ.  While this sounds nice, it does sound a bit 
farfetched.

Comments?

I have one minor quibble with your mlprof flags.  I think that the
default behavior should be that -s is on, since it leads to useful
info for the GC code, which is the usual case for C code that the
profiler sees.