
Hello Jim, Thursday, March 27, 2008, 12:33:20 AM, you wrote:
-Multi-core parallelism is working, but not as well as I'd expect: I get about a 25% reduction in runtime on two cores rather than 50%. I split
this may be an effect of limited memory bandwidth
-Memory consumption is atrocious: 146 megs to render a scene that's a
standard answer: ByteString
-Collecting rendering stats is not easy without global variables. It occurs to me that it would be neat if there were some sort of write-only global variables that can be incremented by pure code but can only be read from within monadic code; that would be sufficient to ensure that the pure code wasn't affected by the values.
the code is called *pure* exactly because it has no side-effects and compiler may select either to call some function two times or reuse already computed result. actually, you can make sideeffects with unsafePerformIO, but there is no guarantees of how many times such code will be executed. try this: plus a b = unsafePerformIO (modifyIORef counter (+1)) `seq` a+b -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com