[Haskell-cafe] g++ std:map vs GHC IntMap

Manlio Perillo manlio_perillo at libero.it
Thu Mar 26 11:39:12 EDT 2009


I have tried to compare performance of the g++ std::map versus the GHC 

The test consists in adding 10000000 elements to an empty map.

Haskell code is here:

C++ code is here:

The execution time and CPU usage is almost the same.
However the C++ version requires 305 MB, the GHC version 617 MB.

gcc 4.3.2
ghc 6.8.2
on Debian Linux Lenny, i386.

Isn't really possible to optimize memory usage in cases like this?

I also tried with Data.HashTable:

but memory usage is 703 MB, and execution time is about 4.5 times slower!

Thanks  Manlio Perillo

More information about the Haskell-Cafe mailing list