summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
Diffstat (limited to 'bench')
-rw-r--r--bench/Main.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/bench/Main.hs b/bench/Main.hs
index 70eb4822..6662b953 100644
--- a/bench/Main.hs
+++ b/bench/Main.hs
@@ -55,6 +55,13 @@ selectionStrictFirst n = strictFirst (BT.empty n) (BT.empty n) []
55selectionStrictLast :: Int -> Maybe Int 55selectionStrictLast :: Int -> Maybe Int
56selectionStrictLast n = strictLast (BT.empty n) (BT.empty n) [] 56selectionStrictLast n = strictLast (BT.empty n) (BT.empty n) []
57 57
58selectionRarestFirst :: Int -> Maybe Int
59selectionRarestFirst n = rarestFirst (BT.empty n) (BT.empty n)
60 (replicate 10 (BT.empty n))
61
62selectionEndGame :: Int -> Maybe Int
63selectionEndGame n = endGame (BT.empty n) (BT.empty n) []
64
58main :: IO () 65main :: IO ()
59main = do 66main = do
60 let blockixs = replicate 5000 (Request (BlockIx 0 0 0)) 67 let blockixs = replicate 5000 (Request (BlockIx 0 0 0))
@@ -71,7 +78,7 @@ main = do
71 , ("choke", chokes) 78 , ("choke", chokes)
72 , ("havenone", havenones) 79 , ("havenone", havenones)
73 ] 80 ]
74 ++ -- 256KiB * 10M = 2.5TiB 81 ++ -- 256KiB * 10M = 2.5TiB bitfield for 10 ms
75 [ bench "bitfield/min" $ nf bitfieldMin (10 * m) 82 [ bench "bitfield/min" $ nf bitfieldMin (10 * m)
76 , bench "bitfield/max" $ nf bitfieldMax (10 * m) 83 , bench "bitfield/max" $ nf bitfieldMax (10 * m)
77 , bench "bitfield/difference" $ nf bitfieldDiff (10 * m) 84 , bench "bitfield/difference" $ nf bitfieldDiff (10 * m)
@@ -79,7 +86,9 @@ main = do
79 , bench "bitfield/union" $ nf bitfieldUnion (10 * m) 86 , bench "bitfield/union" $ nf bitfieldUnion (10 * m)
80 87
81 , bench "selection/strictFirst" $ nf selectionStrictFirst (10 * m) 88 , bench "selection/strictFirst" $ nf selectionStrictFirst (10 * m)
82 , bench "selection/strictFirst" $ nf selectionStrictLast (10 * m) 89 , bench "selection/strictLast" $ nf selectionStrictLast (10 * m)
90 , bench "selection/rarestFirst" $ nf selectionRarestFirst (10 * m)
91 , bench "selection/endGame" $ nf selectionEndGame (10 * m)
83 ] 92 ]
84 where 93 where
85 mkMsgBench name msgs = 94 mkMsgBench name msgs =