[MLton-user] MLton on mswin7 absurdly slow ?

Anders Petersson demitar at gmail.com
Fri Feb 4 13:33:21 PST 2011


On Fri, Feb 4, 2011 at 8:18 PM, John B Thiel <jbthiel at gmail.com> wrote:

> It takes 5 minutes and 300MB of core to compile a helloworld.sml with one
> line:
>   print "Hello, world!\n";
>
> and it keeps taking that long on subsequent tries.  (I thought maybe
> the very first pass it was building some libraries... thus tried a few
> times)


MLton is a whole-program compiler so it will compile all sources in
libraries every time it compiles (with the aggressive dead-code elimination
this is less of an issue than it might seem).

That said, five minutes does seem rather excessive, here that same program
compiles in less than four seconds.

In my understanding, if mlton has trouble determining the amount of actually
free memory it might keep allocating rather than letting the gc run (not
running the gc too often seems to be usually beneficial).

When I was using it on a system with limited memory I recall improved
compile times with:

mlton @MLton max-heap 0.5g -- helloworld.sml
or
mlton @MLton fixed-heap 0.5g -- helloworld.sml

Also, you can get a breakdown of what takes time by compiling with "mlton
-verbose 1 helloworld.sml" (or -verbose 2 for a more detailed breakdown).

That said, I haven't used MLton on windows myself in quite a while so it
might be something completely different going on.

Also, welcome to using MLton. It's a lovely piece of software that grows on
you. :)

/Anders
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton-user/attachments/20110204/3967a97a/attachment.htm


More information about the MLton-user mailing list