[MLton] cvs commit: sped up output1 a lot
Stephen Weeks
MLton@mlton.org
Fri, 2 Jan 2004 13:32:12 -0800
> Ok, that eplains things. In the code I use, and I would argue the
> common case, I won't see a huge gain then.
I disagree. Much of the speedup from my checkin came from making the
common case fast, avoiding tests, and avoiding allocation. Those
should all happen whether or not output1 is inlined. True, you
probably won't see speeds (relative to C) like I saw in the
benchmark. But things should be a lot better than they were.
> The right fix is either to force (via a hack) the buffer load code
> from being inlined, or else to cause the inliner to devalue code
> which is in arms of conditionals from being as desirable to inline.
> I don't know how to do the latter correctly.
It might be possible to put in some kind of hack to keep output1 small
enough so that it is always inlined. Could you play around with some
test code and output1 in basis-library/io/stream-io.fun to see if you
can make it work? Before doing so, it might be worth it to run some
tests to see how much the lack of inlining really hurts.