[Haskell-cafe] g++ std:map vs GHC IntMap
jon at ffconsultancy.com
Sat Apr 4 06:42:37 EDT 2009
On Thursday 26 March 2009 15:39:12 Manlio Perillo wrote:
> I also tried with Data.HashTable:
> but memory usage is 703 MB, and execution time is about 4.5 times slower!
This is due to a perf bug in GHC's GC implementation that causes it to
traverse entire arrays when a single element has been changed. Hence the
Haskell is over an order of magnitude slower than most languages and even
slower than Python (!).
The purely functional trees that you also used are apparently the idiomatic
Haskell workaround but, of course, they are extremely inefficient and still
over an order of magnitude slower than any decent hash table.
Haskell hash table: 44s
Haskell map: 7s
F# hash table: 0.7s
Dr Jon Harrop, Flying Frog Consultancy Ltd.
More information about the Haskell-Cafe