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

h : haskell-cafe@haskell.org 4 April 2009 • 6:42PM -0400

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

REPLY TO AUTHOR
 
REPLY TO GROUP



On Thursday 26 March 2009 15:39:12 Manlio Perillo wrote:
> I also tried with Data.HashTable:
> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2902
>
> 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.
http://www.ffconsultancy.com/?e
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@hask...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

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