git.iko.soy/distributed-process
on master help sign in
Whoops, left some debugging code in
c7f72ceEdsko de Vries
benchmarks/Indirection.gnuplot+1−1
@@ -5,7 +5,7 @@ plot "JustPingWithHeader.data" smooth bezier with lines title "JustPingWithHeade
5 "JustPingThroughMVar.data" smooth bezier with lines title "JustPingThroughMVar", \
5 "JustPingThroughMVar.data" smooth bezier with lines title "JustPingThroughMVar", \
6 "JustPingTransport.data" smooth bezier with lines title "JustPingTransport"
6 "JustPingTransport.data" smooth bezier with lines title "JustPingTransport"
7set terminal postscript color
7set terminal postscript color
8−set output "Headers.ps"
8+set output "Indirection.ps"
9plot "JustPingWithHeader.data" smooth bezier with lines title "JustPingWithHeader", \
9plot "JustPingWithHeader.data" smooth bezier with lines title "JustPingWithHeader", \
10 "JustPingThroughChan.data" smooth bezier with lines title "JustPingThroughChan", \
10 "JustPingThroughChan.data" smooth bezier with lines title "JustPingThroughChan", \
11 "JustPingThroughMVar.data" smooth bezier with lines title "JustPingThroughMVar", \
11 "JustPingThroughMVar.data" smooth bezier with lines title "JustPingThroughMVar", \
benchmarks/JustPingTransport.hs+3−3
@@ -78,10 +78,10 @@ ping sourceEndPing targetEndPong pings = go pings
78 putStrLn $ "client did " ++ show pings ++ " pings"
78 putStrLn $ "client did " ++ show pings ++ " pings"
79 go !i = do
79 go !i = do
80 before <- getCurrentTime
80 before <- getCurrentTime
81− send sourceEndPing (replicate i pingMessage)
81+ send sourceEndPing [pingMessage]
82 [bs] <- receive targetEndPong
82 [bs] <- receive targetEndPong
83 after <- getCurrentTime
83 after <- getCurrentTime
84− putStrLn $ "client received " ++ unpack bs
84+ -- putStrLn $ "client received " ++ unpack bs
85 let latency = (1e6 :: Double) * realToFrac (diffUTCTime after before)
85 let latency = (1e6 :: Double) * realToFrac (diffUTCTime after before)
86 hPutStrLn stderr $ show i ++ " " ++ show latency
86 hPutStrLn stderr $ show i ++ " " ++ show latency
87 go (i - 1)
87 go (i - 1)
@@ -89,7 +89,7 @@ ping sourceEndPing targetEndPong pings = go pings
89pong :: TargetEnd -> SourceEnd -> IO ()
89pong :: TargetEnd -> SourceEnd -> IO ()
90pong targetEndPing sourceEndPong = do
90pong targetEndPing sourceEndPong = do
91 [bs] <- receive targetEndPing
91 [bs] <- receive targetEndPing
92− putStrLn $ "server received " ++ unpack bs
92+ -- putStrLn $ "server received " ++ unpack bs
93 when (BS.length bs > 0) $ do
93 when (BS.length bs > 0) $ do
94 send sourceEndPong [bs]
94 send sourceEndPong [bs]
95 pong targetEndPing sourceEndPong
95 pong targetEndPing sourceEndPong