[MLton-user] Performances: mlton 20030716p1 V.S. 20051202

Stephen Weeks sweeks@sweeks.com
Wed, 26 Jul 2006 15:36:04 -0700


> We are currently running mlton-20030716p1 and we want to migrate to
> the last version mlton-20051202.
>
> Unfortunately, we are facing some high performances regression using
> this new release (something around 60%) compare to our current
> version.
>
> We are compiling with the following options for mlton-20051202:
> mlton -codegen native -const "Exn.keepHistory true" -verbose 2 \
...
> And for the version mlton-20030716p1:
> mlton -cc-opt -D_UNIX -verbose 1 -text-io-buf-size 65536 \
>       -safe true -exn-history true -detect-overflow false -basis 1997 \
...

The one thing that jumps out at me is your use of exception history.
The implementation of that has changed significantly since 20030716.
It is now much more accurate, but causes a potentialy large slowdown
(I could believe even 60%).  It used to simply piggyback on exceptions
as they got raised and handled and so gave a very incomplete view of
the call stack.  Now, it brings in the entire profiling infrastructure
to keep track of every frame in the call stack.  This inhibits
optimizations, and even worse, walks the entire call stack at every
raise (to collect the information for accurate history information).

At this point and going forward, exception history should really only
be used for debugging.

> Does the fact to compile a big defunct sml file can change things on
> performances instead of compiling files with mlb ?

No, that shouldn't matter at all.


Let us know if disabling exception history returns performance to the
level you expect.