<font face="verdana,sans-serif">If you can give an example of some underperforming code, I&#39;m sure someone (or several people) on this list would be more than happy to help you make it more performant.<br><br>Generally, it doesn&#39;t take much. It&#39;s all in knowing where to look. Also, if you know performance is key, you should be using the performance-oriented data structures (ByteString, Text, Vector) from the very beginning. Personally, I never find myself using Data.Array, and rarely use String in real code. It&#39;s just not worth the performance headaches.<br>

<br>And finally, depending on what you&#39;re doing, neither Haskell, nor C might be right for you! Especially with certain numerics-related code, you might find fortran, OpenCL, or CUDA easier to make performant.<br><br>

Examples of this would be lovely.<br><br>  - Clark<br></font><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 29, 2012 at 2:00 PM, Alfredo Di Napoli <span dir="ltr">&lt;<a href="mailto:alfredo.dinapoli@gmail.com" target="_blank">alfredo.dinapoli@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there,<div>I&#39;m only an amateur so just my 2 cent: Haskell can be really fast, but reaching that speed can be all but trivial: you need to use different data types (e.g. ByteString vs. the normal String type) relies on &quot;unconventional&quot; IO (e.g. Conduit, Iterateee) and still be ready to go &quot;out of the base&quot;, using packages and functions wich are not in base/haskell platform (e.g. mwc-random).</div>


<div><br></div><div>My 2 cents :)</div><div>A.<br><br><div class="gmail_quote">On 29 November 2012 18:09, Fixie Fixie <span dir="ltr">&lt;<a href="mailto:fixie.fixie@rocketmail.com" target="_blank">fixie.fixie@rocketmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><span style="font-family:arial,helvetica,sans-serif">Hi all haskellers</span></div>


<div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div style="font-style:normal;background-color:transparent"><span style="font-family:arial,helvetica,sans-serif">I every now and then get the feeling that doing my job code in Haskell would be a good idea.</span></div>


<div style="font-style:normal;background-color:transparent"><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div style="font-style:normal;background-color:transparent"><span style="font-family:arial,helvetica,sans-serif">I have tried a couple of times, but each time I seem to run into performance problems - I do lots of heavy
 computing.</span></div><div style="font-style:normal;background-color:transparent"><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div style="font-style:normal;background-color:transparent"><span style="font-family:arial,helvetica,sans-serif">The problem seems to be connected to lazy loading, which makes my programs so slow that I really can not show them to anyone. I have tried all tricks in the books, like !, seq, non-lazy datatypes...</span></div>


<div style="font-style:normal;background-color:transparent"><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div style="font-style:normal;background-color:transparent"><span style="font-family:arial,helvetica,sans-serif">I was poking around to see if this had changed, then I ran into this forum
 post: <a href="http://stackoverflow.com/questions/9409634/is-indexing-of-data-vector-unboxed-mutable-mvector-really-this-slow" target="_blank">http://stackoverflow.com/questions/9409634/is-indexing-of-data-vector-unboxed-mutable-mvector-really-this-slow</a></span></div>


<div style="font-style:normal;background-color:transparent"><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div style="font-style:normal;background-color:transparent"><span style="font-family:arial,helvetica,sans-serif"><span>The last solution was a haskell program which was in the 3x range to C, which I think is ok. This was in the days </span><font><span style="line-height:18px">of ghc 7.0</span></font></span></div>


<div style="font-style:normal;background-color:transparent"><font><span style="line-height:18px;font-family:arial,helvetica,sans-serif"><br></span></font></div><div style="font-style:normal;background-color:transparent">

<font><span style="line-height:18px;font-family:arial,helvetica,sans-serif">I then tried compile the programs myself (ghc 7.4.1), but found that now the C program now was more that 100x faster. The ghc code was compiled with both O2 and O3, giving only small differences on my 64-bit Linux box.</span></font></div>


<div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif"><font><span style="line-height:18px;font-family:arial,helvetica,sans-serif"><br></span></font></div><div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif">


<font><span style="line-height:18px;font-family:arial,helvetica,sans-serif">So it seems something has changed - and even small examples are still not safe when it comes to the lazy-monster. It reminds me of some code I read a couple of years ago where one of the Simons actually
 fired off a new thread, to make sure a variable was realized.</span></font></div><div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif"><font><span style="line-height:18px;font-family:arial,helvetica,sans-serif"><br>


</span></font></div><div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif"><font><span style="line-height:18px;font-family:arial,helvetica,sans-serif">A sad thing, since I am More that willing to go for Haskell if proves to be usable. If anyone can see what is wrong with the code (there are two haskell versions on the page, I have tried the last and fastest one) it would also be interesting.</span></font></div>


<div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif"><font><span style="line-height:18px;font-family:arial,helvetica,sans-serif"><br></span></font></div><div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif">


<font><span style="line-height:18px;font-family:arial,helvetica,sans-serif">What is your experience, dear haskellers? To me it seems this beautiful language is useless without a better lazy/eager-analyzer.</span></font></div>


<div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif"><font><span style="line-height:18px;font-family:arial,helvetica,sans-serif"><br></span></font></div><div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif">


<font><span style="line-height:18px;font-family:arial,helvetica,sans-serif">Cheers,</span></font></div><div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif"><font><span style="line-height:18px;font-family:arial,helvetica,sans-serif"><br>


</span></font></div><div style="font-size:16px;font-style:normal;background-color:transparent;font-family:arial,helvetica,sans-serif"><font><span style="line-height:18px;font-family:arial,helvetica,sans-serif">Felix</span></font></div>


</div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">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>
<br></blockquote></div><br></div>
<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>
<br></blockquote></div><br></div>