
11 Apr
2011
11 Apr
'11
2:36 p.m.
On Mon, Apr 11, 2011 at 3:55 PM, Serguei Son
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