[Haskell-cafe] How can I improve the pipes's performance with a huge file?

Wojtek Narczyński wojtek at power.com.pl
Fri Nov 14 16:47:16 UTC 2014


On 14.11.2014 10:43, zhangjun.julian wrote:
>
> emptyMap = DM.empty::(DM.Map (String,String) Int)
>
>

Laziness makes your data swell.

1) Try using ByteString or Text instead of String.
2) Try the UNPACK pragma, AFAIR it requires -O2.
     data Key = Key {-# UNPACK #-} !ByteString   {-# UNPACK #-} !ByteString
     https://hackage.haskell.org/package/ghc-datasize - this package 
will help you to determine the actual data size

-- 
Wojtek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141114/41982dec/attachment.html>


More information about the Haskell-Cafe mailing list