mirror of
https://github.com/maciej-bendkowski/generic-boltzmann-brain.git
synced 2024-09-11 12:48:09 +03:00
Use WHNF in benchmarks.
This commit is contained in:
parent
2924341479
commit
90727a1474
@ -1,7 +1,7 @@
|
||||
import BinTree (BinTree)
|
||||
import BinTreeSampler (randomBinTreeIO)
|
||||
import Control.Monad (replicateM)
|
||||
import Criterion.Main (bench, defaultMain, nfIO)
|
||||
import Criterion.Main (bench, defaultMain, whnfIO)
|
||||
|
||||
sampler :: Int -> Int -> Int -> IO [BinTree]
|
||||
sampler n lb ub = replicateM n (randomBinTreeIO lb ub)
|
||||
@ -9,5 +9,9 @@ sampler n lb ub = replicateM n (randomBinTreeIO lb ub)
|
||||
main :: IO ()
|
||||
main =
|
||||
defaultMain
|
||||
[ bench "binTree" $ nfIO (sampler 100 3600 4400)
|
||||
[ bench "1 binary tree" $ whnfIO (sampler 1 3600 4400)
|
||||
, bench "10 binary trees" $ whnfIO (sampler 10 3600 4400)
|
||||
, bench "100 binary trees" $ whnfIO (sampler 100 3600 4400)
|
||||
, bench "1000 binary trees" $ whnfIO (sampler 1000 3600 4400)
|
||||
, bench "10,000 binary trees" $ whnfIO (sampler 10000 3600 4400)
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user