<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>input too fast</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<BR>

<P><FONT SIZE=2 FACE="Arial">I submitted a sum-file entry to the shootout, which worked</FONT>

<BR><FONT SIZE=2 FACE="Arial">nicely in my environment(*), but failed miserably in the </FONT>

<BR><FONT SIZE=2 FACE="Arial">official benchmark.</FONT>
</P>

<P><A HREF="http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&lang=hipe&id=2"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&lang=hipe&id=2</FONT></U></A>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial">It uses the (admittedly undocumented) command-line flag for</FONT>

<BR><FONT SIZE=2 FACE="Arial">installing a custom user process, and opens stdin in line-</FONT>

<BR><FONT SIZE=2 FACE="Arial">oriented mode.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">The problem is that it runs out of memory. As far as I can make</FONT>

<BR><FONT SIZE=2 FACE="Arial">out, it's because the emulator chops up lines and sends them</FONT>

<BR><FONT SIZE=2 FACE="Arial">to the process at such a high rate that, even though the </FONT>

<BR><FONT SIZE=2 FACE="Arial">process is in a tight loop and doing minimal work on each item,</FONT>

<BR><FONT SIZE=2 FACE="Arial">it can't stop the message queue from building up.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">This has disastrous effects when the input file is large enough.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I realise that the feature is undocumented, but perhaps it's still</FONT>

<BR><FONT SIZE=2 FACE="Arial">a valid point - some sort of generic flow-control on ports, </FONT>

<BR><FONT SIZE=2 FACE="Arial">similar to the {active, bool()} on sockets, would be just the</FONT>

<BR><FONT SIZE=2 FACE="Arial">thing here.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">(*) I realise that I tested it in an NFS-mounted disk (on a clearcase-</FONT>

<BR><FONT SIZE=2 FACE="Arial">enabled file system at that). This might have given the port </FONT>

<BR><FONT SIZE=2 FACE="Arial">sufficient flow control that the program lasted a bit longer, at least.</FONT>
</P>

</BODY>
</HTML>