<div class="gmail_quote">On Fri, Feb 4, 2011 at 8:18 PM, John B Thiel <span dir="ltr"><<a href="mailto:jbthiel@gmail.com">jbthiel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
It takes 5 minutes and 300MB of core to compile a helloworld.sml with one line:<br>
print "Hello, world!\n";<br>
<br>
and it keeps taking that long on subsequent tries. (I thought maybe<br>
the very first pass it was building some libraries... thus tried a few<br>
times) </blockquote><div><br></div><div>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).</div>
<div><br></div><div>That said, five minutes does seem rather excessive, here that same program compiles in less than four seconds.</div><div><br></div><div>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).</div>
<div><br></div><div>When I was using it on a system with limited memory I recall improved compile times with:</div><div><br></div><div>mlton @MLton max-heap 0.5g -- helloworld.sml</div><div>or</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
mlton @MLton fixed-heap 0.5g -- helloworld.sml</div></div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>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).</div>
</div><div><br></div><div>That said, I haven't used MLton on windows myself in quite a while so it might be something completely different going on.</div><div><br></div><div>Also, welcome to using MLton. It's a lovely piece of software that grows on you. :)</div>
<div><br></div><div>/Anders</div></div>