[MLton] ref flattening enabled

Neophytos Michael nmichael@yahoo.com
Sat, 24 Jul 2004 12:30:44 -0700 (PDT)

> MLton compiled without ref flattening, compiling itself.
>       pre codegen finished in 174.42 + 102.14 (37% GC)
>       x86 code gen finished in 191.35 + 122.13 (39% GC)
>    Compile SML finished in 365.87 + 224.27 (38% GC)
> MLton finished in 395.62 + 224.97 (36% GC)
> total allocated: 32,161,277,200 bytes
> So, ref flatening cut total allocation by about 3%, and cut the
> "Compile SML" time by about 8%.  Not too bad.

That sounds great.  When translating C code to ML I usually try to go to the
functional programming equivalent but there are times when I just give up and
use references.  If the C program in question does not contain dreaded "goto"
statements then using references the translation is straightforward.  So this
optimization will help my code a lot.

> One oddity is that the executable compiled with ref flattening is
> 9,980,206 bytes, while it is only 8,752,477 without ref flattening.

Any idea as to why this happened?  If anything I would expect the executable to
shrink.  Is it something that will happen general or is it a specific to this
particular program?


Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!