summaryrefslogtreecommitdiff
path: root/bench/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'bench/Main.hs')
-rw-r--r--bench/Main.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/bench/Main.hs b/bench/Main.hs
index 411282a0..87d39f14 100644
--- a/bench/Main.hs
+++ b/bench/Main.hs
@@ -1,6 +1,9 @@
1{-# LANGUAGE OverloadedStrings #-} 1{-# LANGUAGE OverloadedStrings #-}
2module Main (main) where 2module Main (main) where
3 3
4import Control.Monad
5import Data.ByteString (ByteString)
6import qualified Data.ByteString as B
4import Criterion.Main 7import Criterion.Main
5import Remote.KRPC 8import Remote.KRPC
6 9
@@ -8,10 +11,12 @@ import Remote.KRPC
8addr :: RemoteAddr 11addr :: RemoteAddr
9addr = (0, 6000) 12addr = (0, 6000)
10 13
11echo :: Method [Int] [Int] 14echo :: Method ByteString ByteString
12echo = method "echo" ["x"] ["x"] 15echo = method "echo" ["x"] ["x"]
13 16
14main :: IO () 17main :: IO ()
15main = defaultMain $ map mkbench [1, 10, 100, 1000] 18main = defaultMain $ map (mkbench 1) [1, 10, 100, 1000, 32 * 1024]
19 ++ map (mkbench 10) [1, 10, 100, 1000]
16 where 20 where
17 mkbench n = bench (show n) $ nfIO $ call addr echo [1..n] \ No newline at end of file 21 mkbench r n = bench (show r ++ "/" ++ show n) $ nfIO $
22 replicateM r $ call addr echo (B.replicate n 0) \ No newline at end of file