[Haskell-cafe] help optimizing memory usage for a program

Manlio Perillo manlio_perillo at libero.it
Mon Mar 2 16:58:58 EST 2009

Manlio Perillo ha scritto:
> [...]
> I have executed the program, using the same RTS flags as yours:
>   real    6m13.523s
>   user    0m53.931s
>   sys    0m7.812s
>   815 MB usage
> This is an huge improvement!
> Now I have to check if using insert will further improve memory usage.

And ... surprise!

   real	6m12.036s
   user	0m51.303s
   sys	0m8.433s

   813 MB usage

As I suspected (you just have to read the IntMap code), there is
*no reason* why empty + insert should be better then singleton + union.

So the culprit is elsewhere.

It may be the use of uvector, or probably it is because you force strict 
evaluation more often then me.

 > [...]

Regards  Manlio

More information about the Haskell-Cafe mailing list