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@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to