[Haskell-cafe] proper way to generate a random data in criterion
johan.tibell at gmail.com
Wed Oct 19 17:03:04 CEST 2011
On Wed, Oct 19, 2011 at 1:13 AM, Kazu Yamamoto <kazu at iij.ad.jp> wrote:
> I'm measuring performance of the insertion operation of red-black
> trees. For input, three kinds of [Int] are prepared: the increasing
> the order, decreasing order, and random.
> The random case is 4 or 5 times slower than the others. I'm afraid
> that my program also measured the cost of random Int generation.
> My benchmark code can be found:
> Does anyone kindly take a look and tell me whether or not my criterion
> code measures the cost of random Int generation?
It does. You need to use evaluate to have ensure actually be evaluated.
> If so, would you suggest how to avoid it?
Have a look at:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe