[Haskell-cafe] proper way to generate a random data in criterion

Kazu Yamamoto ( 山本和彦 ) kazu at iij.ad.jp
Wed Oct 19 10:13:11 CEST 2011


Hello,

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:

	https://github.com/kazu-yamamoto/llrbtree/blob/master/bench/insert/Bench.hs

Does anyone kindly take a look and tell me whether or not my criterion
code measures the cost of random Int generation? If so, would you
suggest how to avoid it?

Background infromation can be found:
	Purely Functional Left-Leaning Red-Black Trees
	http://www.mew.org/~kazu/proj/red-black-tree/

--Kazu



More information about the Haskell-Cafe mailing list