<div dir="ltr">You picked the single slowest way to do it. Please see <a href="https://gist.github.com/wyager/df063ad4edd9a9c8b0ab762c91a79894">https://gist.github.com/wyager/df063ad4edd9a9c8b0ab762c91a79894</a><div><br></div><div>All times are on my Intel Atom Macbook. Compiled with -O3, no other options.</div><div><br></div><div>Using Lazy Bytestrings (either through the Builder interface or plain old concatenation) is about 7-7.5 times faster than string concatenation so on your computer it should take about 0.12 seconds. In other words, faster than C.</div><div><br></div><div>This is my usual experience with lazy bytestrings; due to their optimization for cache size, they are extremely fast with almost no effort. They often out-perform "fast" array operations in C due to fusion and cache coherency. </div><div><br></div><div>I will note that if you want to do exactly what C does (often with only slightly different assembly output), you can often achieve this with unboxed vectors (mutable or immutable, depending on your application).</div><div><br></div><div>--Will<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 10:24 PM, Richard A. O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz" target="_blank">ok@cs.otago.ac.nz</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Making a list of "Hello world" 10,000,000 times and then<br>
concatenating that list to produce a single String took<br>
0.87 seconds (start program to end program) in Haskell.<br></blockquote></div></div></div></div>