Skip to content

Commit

Permalink
Dump out rate information for benchmarking.
Browse files Browse the repository at this point in the history
  • Loading branch information
bos committed Mar 22, 2011
1 parent 53cc010 commit cac4b8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions benchmarks/AesonEncode.hs
Expand Up @@ -38,5 +38,7 @@ main = do
Done _ r -> rnf (encode r) `seq` loop (n+1) r
_ -> error $ "failed to read " ++ show arg
loop 0 r
end <- getCurrentTime
putStrLn $ " " ++ show (diffUTCTime end start)
delta <- flip diffUTCTime start `fmap` getCurrentTime
let rate = fromIntegral count / (fromRational . toRational) delta :: Double
putStrLn $ " " ++ show delta
putStrLn $ " " ++ show (round rate) ++ " per second"
6 changes: 4 additions & 2 deletions benchmarks/AesonParse.hs
Expand Up @@ -27,5 +27,7 @@ main = do
Done _ r -> loop (good+1) bad
_ -> loop good (bad+1)
(good, _) <- loop 0 0
end <- getCurrentTime
putStrLn $ " " ++ show good ++ " good, " ++ show (diffUTCTime end start)
delta <- flip diffUTCTime start `fmap` getCurrentTime
putStrLn $ " " ++ show good ++ " good, " ++ show delta
let rate = fromIntegral count / (fromRational . toRational) delta :: Double
putStrLn $ " " ++ show (round rate) ++ " per second"

0 comments on commit cac4b8f

Please sign in to comment.