Hi,<br><br><div class="gmail_quote">On Wed, Oct 19, 2011 at 1:13 AM, Kazu Yamamoto <span dir="ltr">&lt;<a href="mailto:kazu@iij.ad.jp">kazu@iij.ad.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hello,<br>
<br>
I&#39;m measuring performance of the insertion operation of red-black<br>
trees. For input, three kinds of [Int] are prepared: the increasing<br>
the order, decreasing order, and random.<br>
<br>
The random case is 4 or 5 times slower than the others. I&#39;m afraid<br>
that my program also measured the cost of random Int generation.<br>
<br>
My benchmark code can be found:<br>
<br>
        <a href="https://github.com/kazu-yamamoto/llrbtree/blob/master/bench/insert/Bench.hs" target="_blank">https://github.com/kazu-yamamoto/llrbtree/blob/master/bench/insert/Bench.hs</a><br>
<br>
Does anyone kindly take a look and tell me whether or not my criterion<br>
code measures the cost of random Int generation?</blockquote><div><br></div><div>It does. You need to use evaluate to have ensure actually be evaluated.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

If so, would you suggest how to avoid it?<br></blockquote><div><br></div><div>Have a look at:</div><div><br></div><div>    <a href="https://github.com/tibbe/unordered-containers/blob/master/benchmarks/Benchmarks.hs">https://github.com/tibbe/unordered-containers/blob/master/benchmarks/Benchmarks.hs</a></div>

<div><br></div><div>-- Johan</div><div><br></div></div>