[MLton] cvs commit: MAIL: PosixError.SysCall changes

Matthew Fluet fluet@cs.cornell.edu
Mon, 3 May 2004 08:37:41 -0400 (EDT)

> > > One general worry I have is the use of {restart = false} to optimize
> > > system calls which are believed to never return EINTR.
> ...
> > I haven't done any benchmarks or anything, so I don't know if there is an
> > appreciable slowdown in the new code.  I strongly doubt it, as in the
> > common case, we are only doing one additional comparison.
> I understand this to mean that the additional comparison is "errno =
> intr", which I agree is cheap.  Hence, I don't see the benefit of the
> "restart andalso" optimization to eliminate this test.

I'm happy enough to drop the optimization, but I haven't benchmarked or
looked at the SSA code.  While there is only one more cheap test, the fact
that we introduce a loop and additional control-flow probably impacts the
resulting code.

> > And I got a major speed up in CML by only wrapping print with
> > atomicBegin/atomicEnd rather than block/unblock.
> This makes perfect sense, since atomic{Begin,End} are a few
> instructions, while block/unblock are system calls.  But I don't see
> the relevance to the restart optimization.

I was just pointing out that even when we are doing a restart, it's much
better than block/unblock, which was the alternative before adding
SysCall.* functions.