[MLton] cvs commit: sped up output1 a lot

Henry Cejtin henry@sourcelight.com
Fri, 2 Jan 2004 17:46:26 -0600


I  don't  see how it is arranged to make putc be the non-locked version.  The
point is that you can make the function which  is  called  be  the  same  (by
clever library ordering) but you can't convert it into a macro.  The compiler
can't know when it compiles some code if it is going to be linked with thread
producing code.

Don't  get  me  wrong,  I  think that making getc/putc run slowly in the non-
thread case is unacceptable, but I  don't  see  a  solution.   Am  I  missing
something?  The only trick that I can think of is to make the count always be
0 in the threaded case, so you will never inline the actual flow then.  Given
that  you  are  going  to  have to acquire a lock, it shouldn't hurt too much
more.

Re  system  calls being expensive, I would be really surprised if they are so
expensive that switching from a 4K BUFSIZ to  a  64K  one  really  makes  any
appreciable difference.  We could switch that though.