[Haskell-cafe] Efficient functional idiom for histogram

Yitzchak Gale gale at sefer.org
Wed Aug 5 11:01:56 EDT 2009


Dmitry Olshansky wrote:
> My measurements show that...
> (-O2 gives approx 2 time impovements).
> ...using RandomGen and State monad to generate a list gives at least 4 times
> improvements (on 1 000 000 items).

You earlier said:

> this takes over twice as long as a naively implemented
Python program

So now our "naive" Haskell - ordinary usage of Data.Map
and System.Random, without resorting to things like
unboxed arrays - is beating naive Python handily. Correct?

Or is this with an alternate RNG? Although I think even that
would be fair, since Python uses Mersenne.

Regards,
Yitz


More information about the Haskell-Cafe mailing list