<div>Well C# does it with a for loop in 2300ms, and when using a IEnumerable sequence it needs&nbsp;19936ms. Very much like the Haskell code. But of course the Haskell code could optimize the sum I guess, I assume it is using the lazy version of sum by default.</div>
<div><br></div><div>Anyway it was more of a question.&nbsp;Does GHC perform register allocation (e.g. using graph colouring) &nbsp;and loop unrolling?<br></div><div><div><br><div class="gmail_quote">On Fri, Feb 20, 2009 at 4:22 PM, Colin Paul Adams <span dir="ltr">&lt;<a href="mailto:colin@colina.demon.co.uk">colin@colina.demon.co.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">&gt;&gt;&gt;&gt;&gt; &quot;Peter&quot; == Peter Verswyvelen &lt;<a href="mailto:bugfact@gmail.com">bugfact@gmail.com</a>&gt; writes:<br>

<br>
 &nbsp; &nbsp;Peter&gt; So GHC is about 3 to 4 times slower as Visual C++ / GCC<br>
 &nbsp; &nbsp;Peter&gt; without loop unrolling, which is not too bad since GHC does<br>
 &nbsp; &nbsp;Peter&gt; not perform register optimization and loop unrolling yet<br>
 &nbsp; &nbsp;Peter&gt; no?<br>
<br>
I would call it rather poor.<br>
<br>
And I don&#39;t accept a since of that form as valid mitigation.<br>
<font color="#888888">--<br>
Colin Adams<br>
Preston Lancashire<br>
</font></blockquote></div><br></div></div>