Well, Steve wrote:<div><br></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">&gt; I compared the top 10 C/C++ results against the top 10 Haskell results:</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">So to me it seems he&#39;s not talking about his code.</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">Anyway, I thought Haskell&#39;s ByteString IO should not be that much slower anyway.</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">Not sure how lazy ByteString IO is implemented, but if it performs async (aka overlapped) IO, it could be very very fast (faster than C), since the reading of the next buffer from (or writing of the previous buffer to) the file is then completely parallel with the computation (when done inplace you even don&#39;t need a memcpy, although these days the overhead of copying 64KB of memory might be very tiny, it used to be different in the old days :-) At least that&#39;s how I did it in the past in C++ with templates, which was faster than the C approach.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></div><div>On Sun, Aug 30, 2009 at 2:15 PM, Bulat Ziganshin <span dir="ltr">&lt;<a href="mailto:bulat.ziganshin@gmail.com">bulat.ziganshin@gmail.com</a>&gt;</span> wrote:</div>
<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello Steve,<br>
<div class="im"><br>
Sunday, August 30, 2009, 3:54:53 PM, you wrote:<br>
<br>
&gt; So it looks like Haskell is ~13 slower for IO than C/C++, even (I<br>
&gt; assume) when using Data.ByteString or other speed-up tricks.<br>
<br>
</div>it means that *your* program is 13x slower than C one and nothing<br>
more. in particular, your program may be constrained by readInt<br>
speed<br>
<font color="#888888"><br>
<br>
--<br>
Best regards,<br>
 Bulat                            mailto:<a href="mailto:Bulat.Ziganshin@gmail.com">Bulat.Ziganshin@gmail.com</a><br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>