Find in this group all groups
The Haskell Cafe more information…

h : 4 April 2009 • 6:42PM -0400

Re: [Haskell-cafe] g++ std:map vs GHC IntMap
by Jon Harrop


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.

For comparison:

Haskell hash table: 44s
Haskell map:         7s
F# hash table:       0.7s

Dr Jon Harrop, Flying Frog Consultancy Ltd.
Haskell-Cafe mailing list

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.