code sizes

Stephen Weeks MLton@sourcelight.com
Tue, 2 Jan 2001 10:57:48 -0800 (PST)


(Feel free to forward this to Franklyn.  I'd be interested in hearing about the
latest CIL efforts as well.)

> Franklyn Turbak sent me a note recently asking about
> code sizes in MLton.  Do we have any recent numbers on
> code sizes (in comparison with NJ) for our benchmark
> suite?  I think it would be especially nice to compare
> code size of executables produced by the native-code
> backend with NJ. 

There are numbers at
	http://www.sourcelight.com/MLton/HTML/node12.html 

Things haven't changed too much since then, even with the native backend.  As to
comparing with NJ, we don't have a good way to compare, since the only way I
know of to get code sizes in NJ is to do an SMLofNJ.exportFn and look at the
heap size.  Unfortunately, they don't do a very good job of gc'ing the heap, so
there seems to be about a 300K overhead even for the smallest program.  So, the
upshot is that MLton's code sizes are *much* smaller, but it doesn't mean much.
A long long time ago I mucked around with the NJ compiler internals and found a
way to print code sizes after each compile pass.  It wasn't too hard, but I'm
not up for doing it again.