
From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Roel van Dijk
I replaced the standard random number generated with the one from mersenne-random. On my system this makes the resulting program about 14 times faster than the original. I also made a change to accumulateHit because it doesn't need to count to total. That is already known.
I tried this too, but got a seg fault (!), so I stripped it back to a small test program. This is with mersenne-random, setup configured with -fuse_sse2: module Main (main) where import System.Random.Mersenne import System (getArgs) rands :: Int -> IO [Double] rands samples = do rng <- getStdGen rns <- randoms rng return (take (2*samples) rns) main = do args <- getArgs let samples = read (head args) randomNumbers <- rands samples print randomNumbers On WinXp with ghc-6.10.1 it always seg faults. If I rebuild without -fuse-sse2 then it's happy. I'm assuming that my machine has SSE2; it's a little old, but it's a P4 (3GHz), so I think it should. Is there an easy way to tell? Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************