#427: Random.StdGen slowness
---------------------------------+------------------------------------------
Reporter: remit | Owner:
Type: bug | Status: new
Priority: low | Milestone: _|_
Component: libraries/random | Version: 6.4.1
Severity: normal | Resolution: None
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by dons):
Replying to [comment:11 duncan]:
> See also http://haskell.org/pipermail/libraries/2009-March/011390.html
>
> It looks like just adding a bit of strictness to the `StdGen`
constructor and to `getStdRandom` would improve things without much fuss.
Probably needs 10 min to investigate the performance difference.
Adding {-#UNPACK #-}!Int32 didn't help much. I think the problem may still
be all the conversions via Integer.
Here, for example, compared against mersenne-random:
{{{
Generating 26452582 Ints with System.Random:
Computation time: 47.850 sec
Generating 26452582 Ints with System.Random.Mersenne:
Computation time: 0.267 sec
Generaating 26452582 Double's with System.Random:
Computation time: 20.632 sec
And with System.Random.Mersenne:
Computation time: 0.563 sec
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/427#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs