summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
Diffstat (limited to 'bench')
-rw-r--r--bench/Main.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/bench/Main.hs b/bench/Main.hs
index 94341c84..e4f756a3 100644
--- a/bench/Main.hs
+++ b/bench/Main.hs
@@ -48,19 +48,25 @@ bitfieldInter n = BT.empty n `intersection` BT.empty n
48bitfieldUnion :: Int -> Bitfield 48bitfieldUnion :: Int -> Bitfield
49bitfieldUnion n = BT.empty n `union` BT.empty n 49bitfieldUnion n = BT.empty n `union` BT.empty n
50 50
51selectionStrictFirst :: Int -> Maybe Int
52selectionStrictFirst n = strictFirst (BT.empty n) (BT.empty n) []
51 53
52main :: IO () 54main :: IO ()
53main = do 55main = do
54 let datas = replicate 10000 (Request (BlockIx 0 0 0)) 56 let datas = replicate 10000 (Request (BlockIx 0 0 0))
57 let m = 1024 * 1024
55 58
56 defaultMain 59 defaultMain
57 [ datas `deepseq` bench "message/encode" $ nf encodeMessages datas 60 [ datas `deepseq` bench "message/encode" $ nf encodeMessages datas
58 , let binary = encodeMessages datas in 61 , let binary = encodeMessages datas in
59 binary `deepseq` bench "message/decode" $ nf decodeMessages binary 62 binary `deepseq` bench "message/decode" $ nf decodeMessages binary
60 63
61 , bench "bitfield/min" $ nf bitfieldMin 10000000 64 -- ~ 256KiB * 10M = 2.5TiB
62 , bench "bitfield/max" $ nf bitfieldMax 10000000 65 , bench "bitfield/min" $ nf bitfieldMin (10 * m)
63 , bench "bitfield/difference" $ nf bitfieldDiff 10000000 66 , bench "bitfield/max" $ nf bitfieldMax (10 * m)
64 , bench "bitfield/intersection" $ nf bitfieldInter 10000000 67 , bench "bitfield/difference" $ nf bitfieldDiff (10 * m)
65 , bench "bitfield/union" $ nf bitfieldUnion 10000000 68 , bench "bitfield/intersection" $ nf bitfieldInter (10 * m)
69 , bench "bitfield/union" $ nf bitfieldUnion (10 * m)
70
71 , bench "selection/strictFirst" $ nf selectionStrictFirst (10 * m)
66 ] \ No newline at end of file 72 ] \ No newline at end of file