<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 2:09 PM, Bardur Arantsson <span dir="ltr"><<a href="mailto:spam@scientician.net" target="_blank">spam@scientician.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 07/11/2016 02:54 PM, David Fox wrote:<br>
> On Sun, Jul 10, 2016 at 11:44 AM, KC <<a href="mailto:kc1956@gmail.com">kc1956@gmail.com</a><br>
</span><span class="">> <mailto:<a href="mailto:kc1956@gmail.com">kc1956@gmail.com</a>>> wrote:<br>
><br>
>     Is the #functional programming paradigm antithetical to efficient<br>
>     strings? #Haskell<br>
><br>
>  ​I can certainly see how it might seem so.  Our main string<br>
> representation​ uses about 10 times more memory than seems necessary,<br>
> and is relatively fast, though probably not compared to C.  Recently I<br>
> spent some time looking into how to reduce this memory overhead, and I<br>
> modified the pretty library<br>
> (<a href="https://github.com/ddssff/pretty/tree/textdetails" rel="noreferrer" target="_blank">https://github.com/ddssff/pretty/tree/textdetails</a>) so it could use any<br>
> type that was an instance of ListLike and StringLike<br>
> (<a href="https://github.com/JohnLato/listlike" rel="noreferrer" target="_blank">https://github.com/JohnLato/listlike</a><br>
</span>> <<a href="https://github." rel="noreferrer" target="_blank">https://github.</a>.com/JohnLato/listlike>).  Then I tried the UnitLargeDoc<br>
<span class="">> test with several different data types.  This just concatenates a list<br>
> of ten million "Hello" strings.  Using String this happens in about 5<br>
> seconds.  Using strict or lazy Text it immediately blew the stack.  When<br>
> I increased the stack size to over 1GB it took minutes to complete.<br>
> When I used the Data.Text.Lazy.Builder type instead it took about 30<br>
> seconds to complete.  Results with utf8 encoded ByteStrings were siimilar.<br>
><br>
<br>
</span>Did you try similar code on Java/C# (or whatever)?</blockquote><div><br></div><div><div class="gmail_default" style="font-size:small;display:inline">​I did not.​</div> </div></div></div></div>