diff options
Diffstat (limited to 'bench/Main.hs')
-rw-r--r-- | bench/Main.hs | 11 |
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 #-} |
2 | module Main (main) where | 2 | module Main (main) where |
3 | 3 | ||
4 | import Control.Monad | ||
5 | import Data.ByteString (ByteString) | ||
6 | import qualified Data.ByteString as B | ||
4 | import Criterion.Main | 7 | import Criterion.Main |
5 | import Remote.KRPC | 8 | import Remote.KRPC |
6 | 9 | ||
@@ -8,10 +11,12 @@ import Remote.KRPC | |||
8 | addr :: RemoteAddr | 11 | addr :: RemoteAddr |
9 | addr = (0, 6000) | 12 | addr = (0, 6000) |
10 | 13 | ||
11 | echo :: Method [Int] [Int] | 14 | echo :: Method ByteString ByteString |
12 | echo = method "echo" ["x"] ["x"] | 15 | echo = method "echo" ["x"] ["x"] |
13 | 16 | ||
14 | main :: IO () | 17 | main :: IO () |
15 | main = defaultMain $ map mkbench [1, 10, 100, 1000] | 18 | main = 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 | ||