Hi,

Well, we can all relax. Library is good. :-)

My perfect timing function wasn't evaluating pure stuff deep enough in these cases.

However, there still seems to be a difference of about 50% , but I suppose that could be explained with intermediate lists on such large data sets, as Joey Adams said.
I'll benchmark it properly with Criterion, and post the results here, for info.

Sorry for the trouble. :-(

vlatko

-------- Original Message --------
Subject: Re: [Haskell-cafe] JuicyFruit - explanation of speed difference of pure and monadic image generation
From: Alp Mestanogullari <alpmestan@gmail.com>
To: Joey Adams <joeyadams3.14159@gmail.com>
Cc: The Haskell Cafe <haskell-cafe@haskell.org>, vlatko.basic@gmail.com
Date: 20.03.2014 15:43


Could it be because you are calling withImage in IO whereas generateImage coes through ST? A lot of the nice performance numbers of JuicyPixels come from its carefully tailored ST usage, which in turn comes from theefficiency of unboxed mutable vectors (as in the "vector" package).

So could you post the benchmark result for a version where you runST on the result of withImage? That should be a fairer comparison. Also, writing a criterion benchmark would help and make sure the functions are run properly without any of the two taking advantage of computations previsouly performed by the other.