[Haskell-cafe] Efficient string output

Eugene Kirpichov ekirpichov at gmail.com
Mon Feb 9 07:37:59 EST 2009


+1; it's obviously the packing that causes sloth.
Memoize the "pack "\t"" etc. stuff , and write bytestring replacements
for show for your data.
I guess you can use the Put monad instead of B.concat for that, by the way.

2009/2/9 Bulat Ziganshin <bulat.ziganshin at gmail.com>:
> Hello Ketil,
>
> Monday, February 9, 2009, 2:49:05 PM, you wrote:
>
>>                     in B.concat [f1,pack "\t",pack (show f2),...]
>
>> inelegance were it only fast - but this ends up taking the better part
>> of the execution time.
>
> i'm not a BS expert but it seems that you produce Strings using show
> and then convert them to BS. of course this is inefficient - you need
> to replace show with BS analog
>
> --
> Best regards,
>  Bulat                            mailto:Bulat.Ziganshin at gmail.com
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list