On Mon, Apr 11, 2011 at 3:55 PM, Serguei Son <[email protected]> wrote: > So if I must use a safe function returning IO a, > there is no way to improve its performance? To give you > a benchmark, calling gsl_ran_ugaussian a million times > in pure C takes only a second or two on my system.
In the C version, are you also producing a linked list containing all of the values? Because that's what mapM does. Your test is mostly measuring the cost of allocating and filling ~3 million machine words on the heap. Try mapM_ instead. G -- Gregory Collins <[email protected]> _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
