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

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Sun Nov 16 09:47:29 UTC 2014


On Sat, Nov 15, 2014 at 06:50:26AM +0800, zhangjun.julian wrote:
> In the master branch  I had a list file to read, so I use mapM_ to call rCount as blow
> 
> mapM_ (\(x,y) -> rCount num readhandle1 x y) handlePairList
> 
> If I change my Map to Strict and  call rCount directly( don’t use mapM_ ) the memory will not swell.
> 
> I can understand why lazy Map will cause swell, but I don’t know why mapM_ will cause swell?
> Does the mapM_ is lazy too? 
> Any strict alternative I can use?

I think you need to provide us with more details about exactly what this
mapM_ is doing.


More information about the Haskell-Cafe mailing list