[MLton] commit r5257: added option -profile-val

Matthew Fluet fluet at mlton.org
Sun Feb 18 17:01:24 PST 2007


Some very minor additions to the profiling infrastructure, mainly
addressing a comment raised by:
  http://mlton.org/pipermail/mlton-user/2007-January/000992.html

The '-profile-val true' option instructs the compiler to push and pop
profiling information for the evaluation of (expansive) val bindings.
With the program described in the message above, we now have the
following output (with "-const 'Exn.keepHistory true' -profile-val true"):

[fluet at shadow tmp]$ ./z
unhandled exception: Uninitialized
with history:
	r.<raise> z.sml 5.36
	r z.sml 4.9
	<val>:z z.sml 9.9
	<main>

So, we get the very useful information about which top-level binding
is responsible for the exception.

With "-profile-val true -profile-stack true", it should be possible to
distinguish expensive calls to the same function.

I'm not 100% happy with the syntax, so suggestions are welcome.

I also tweaked basis-library/mlton/call-stack.sml to only ignore one
element at the bottom of the call stack; this seems to have solved the
issue with "shallow" call stacks.


----------------------------------------------------------------------

U   mlton/trunk/basis-library/mlton/call-stack.sml
U   mlton/trunk/doc/changelog
U   mlton/trunk/mlton/control/control-flags.sig
U   mlton/trunk/mlton/control/control-flags.sml
U   mlton/trunk/mlton/elaborate/elaborate-core.fun
U   mlton/trunk/mlton/main/main.fun



More information about the MLton mailing list