Paul Moore <p.f.mo...@gmail.com> writes:

> What am I doing wrong here? I'd have expected compiled Haskell to be
> faster than interpreted Python, so obviously my approach is wrong.

Two things from my experience: Python associative arrays are fast, and
Haskell random numbers are slow.  So by building a map from random
numbers, you are likely doing a fairly pessimal comparison.  Did you
profile to see where the time is spent? 

> I'm expecting the answer to be that I've got unnecessary laziness

IME, laziness usually affects space, but not so much time
performance.  Although 'insertWith (+)' looks like it would build
unevaluated thunks for the sums.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to