[MLton-devel] Fwd: Mark Tuttle

Matthew Fluet fluet@cs.cornell.edu
Thu, 1 May 2003 14:30:18 -0400 (EDT)


> > 3.1.  BinIO is missing setPosOut, and BinIO.StreamIO is missing
> > flushOut and getWriter,
> > 3.2.  TextIO is missing openString.  I could write the string to a
> > disk file and open the disk file, but is there a better way?

Yes, these are all supported by the new layered IO implementation.

> Is there any reason why we shouldn't package a MLton with the new IO
> libraries and these changes so that these guys can try it out?

No, all the new IO libraries work, its just some performance on input over
the old IO:

MLton0 -- old io
MLton1 -- new io, imperative IO -> on top of stream IO
MLton2 -- new io, imperative IO -> on top of buffered IO and stream IO

run time ratio
benchmark           MLton1 MLton2
wc-input              1.45   1.01
wc-input1             1.44   0.76
wc-inputLine.short    0.84   0.91
wc-inputLine.long     0.89   1.03
wc-inputN.short       1.57   1.00
wc-inputN.long        2.67   1.01
wc-inputAll           0.95   0.95
wc-inputRand          1.63   1.29
wc-inputF             0.82   0.79
wc-input1F            0.71   5.55
wc-inputLineF.short   0.63   0.92
wc-inputLineF.long    0.13   0.13
wc-inputNF.short      1.51   1.52
wc-inputNF.long       1.11   1.07
wc-inputAllF          0.76   0.75
wc-inputRandF         1.49   1.43
wc-inputS             1.15   1.09
wc-input1S            1.57   1.62
wc-inputLineS.short   0.62   0.64
wc-inputLineS.long    0.13   0.13
wc-inputNS.short      1.68   1.71
wc-inputNS.long       0.94   0.91
wc-inputAllS          0.73   0.72
wc-inputRandS         1.58   1.64
wc-scanStream         1.66   1.58

So, things aren't quite up to snuff with the old IO across the board.
But, I've made plenty of self compiles with the new IO.

> > I just need to write a 4G file, then write a few characters to the
> > head of the file.  Is there an easy solution more efficient than a
> > massive disk file copy?
>
> I'm more worried about this.  Won't we fail on files longer than 2G
> due to 32 bit signed ints?

I've never tested the seeking, just implemented it in what seemed to be
the obvious way.  Mark's particular issue of seeking to the beginning of
the file would seem to be fine, as that position will fit in 32bits.  But
I don't know if there are kernel issues.



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel