[MLton-devel] MLton and profiling

Stephen Weeks MLton@mlton.org
Fri, 31 Jan 2003 14:44:13 -0800

Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit

Hi Joe.  I thought you might be interested to try our newest
experimental version of MLton, 20030130, available at

This version has support for the latest basis library spec as well as
the ability to do source-level time and allocation profiling.  We
don't have space profiling yet, but we're thinking about it.  As an
example of allocation profiling, I profiled your model elimination
benchmark.  Here are the top 10 functions.

7,562,918,976 bytes allocated (2,841,020 bytes by GC)
                  function                    cur  stack   GC 
-------------------------------------------- ----- ------ ----
g  fol/Subst1.sml: 68                        26.6%  30.8% 0.0%
f  fol/Subst1.sml: 79                         9.9%  36.6% 0.0%
expand  src/Meson1.sml: 323                   4.8%  20.0% 0.0%
f  fol/Subst1.sml: 128                        2.1%  30.5% 0.0%
f  fol/Subst1.sml: 87                         1.8%  14.4% 0.0%
o  <basis>/general/general.sml: 30            1.0%  98.1% 0.0%
expand_rule  src/Meson1.sml: 346              0.7%  55.5% 0.0%
freshen_rule  src/Meson1.sml: 275             0.6%  10.4% 0.0%
loop  <basis>/list/list.sml: 39               0.5%  91.6% 0.0%
src/Meson1.sml: 268                           0.2%  18.0% 0.0%

In the table, rows correspond to a source functions (with name and
source position).  "cur", "stack", and "GC" are, respectively, the
percentage of time spent in that function, the percentage of time
spent with that function on the stack (i.e. in it or a nontail
callee), and the percentage of time spent in garbage collection with
that function on the stack.

It is also possible to display a call graph of the profiling data.  I
have attached one to this message.  In the graph, nodes correspond to a
source functions and edges correspond to nontail calls.  The three
percentages are as in the table.

Maybe you will find the profiling stuff helpful in improving this code
or in improving Metis.

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.


Content-Type: application/postscript
Content-Disposition: attachment;
Content-Transfer-Encoding: base64


This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
MLton-devel mailing list