
13 Oct
2007
13 Oct
'07
9:33 p.m.
ntupel wrote:
Thanks for your reply Stefan. Unfortunately I could measure only a relatively small improvement by changing to concrete types
the sample code was about one second faster when compiled with -O2. Profiling again indicated that most time was spend in random and randomR
GHC StdGen's random and randomR are somewhat slow. I found that changing to a custom ((x*a + b) `mod` c) random-generator (instance of RandomGen) much sped things up (since nothing depended on the random numbers being good quality). (Then I switched to a small C function to do the randomization and make all the OpenGL calls, and it sped up by another factor of 4.) Isaac