[MLton] new TextIO

Henry Cejtin henry@sourcelight.com
Wed, 14 Jan 2004 17:17:40 -0600

I  tested  out  a  mod  on January 5th and it sped things up by 17%.  Are you
talking about that or the new experimental MLton (2004-01-06) with the single
test in the common case?  I didn't do that but I will do so now ...

I  just  tried  it  and  it  seems to have made no difference compared to the
change I tested on January 5th.

As a comparison, I just tried the tweaked and an indentical thing where  each
call  to  getchar  and putchar called a C function which then did the inlined
getchar/putchar.  Here are the timings:

        new MLton       15.385 seconds
        fast C           9.000 seconds
        slow C          19.770 seconds

I claim (weakly) that this argues that it is the function call that has to be
eliminated from MLton for the common input1/output1 case.

I  haven't  looked at the new one-test source yet, but that probably makes it
easier to arrange for the inliner to not inline the  uncommon  case  by  just
puting  that code in a function and then calling the function many times from
other places in an un-taken branch of a top-level if.  I looked at doing this
before this final mod, but the code was a bit too spread out.