summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-05-14 10:27:36 +0400
committerSam T <pxqr.sta@gmail.com>2013-05-14 10:27:36 +0400
commitd0038e9bde22751c9c926796a6c46be62a3cb81b (patch)
treed0955ea60d53d672f10e1e7c3be065a65b4193a6 /bench
parenta2bc26abbe6ccea464c04b990f8a4a8fa769ba2a (diff)
~ Minor changes.
Diffstat (limited to 'bench')
-rw-r--r--bench/Main.hs11
-rw-r--r--bench/Server.hs3
2 files changed, 10 insertions, 4 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
diff --git a/bench/Server.hs b/bench/Server.hs
index cb5ed316..ece5a7a9 100644
--- a/bench/Server.hs
+++ b/bench/Server.hs
@@ -1,10 +1,11 @@
1{-# LANGUAGE OverloadedStrings #-} 1{-# LANGUAGE OverloadedStrings #-}
2module Main (main) where 2module Main (main) where
3 3
4import Data.ByteString (ByteString)
4import Remote.KRPC 5import Remote.KRPC
5 6
6 7
7echo :: Method [Int] [Int] 8echo :: Method ByteString ByteString
8echo = method "echo" ["x"] ["x"] 9echo = method "echo" ["x"] ["x"]
9 10
10main :: IO () 11main :: IO ()