on master help sign in
Add fileio benchmark
commit50170f39a55f0378e9354d53bcf0f8369f9b2d15 authorHarendra Kumar <harendra.kumar@gmail.com> dateTue 18 Jun 2019, 23:39 (7 years ago) parentb9dbfaa
1 file changed+15−1
benchmark/Chart.hs+15−1
benchmark/Chart.hs+15−1
@@ -22,7 +22,7 @@ import BenchShow
2222-- Command line parsing
2323------------------------------------------------------------------------------
2424
25−data BenchType = Linear | LinearAsync | LinearRate | Nested | Base
25+data BenchType = Linear | LinearAsync | LinearRate | Nested | Base | FileIO
2626 deriving Show
2727
2828data Options = Options
@@ -62,6 +62,7 @@ parseBench = do
6262 Just "linear-rate" -> setBenchType LinearRate
6363 Just "nested" -> setBenchType Nested
6464 Just "base" -> setBenchType Base
65+ Just "fileio" -> setBenchType FileIO
6566 Just str -> do
6667 liftIO $ putStrLn $ "unrecognized benchmark type " <> str
6768 mzero
@@ -224,6 +225,14 @@ makeLinearRateGraphs cfg inputFile = do
224225 putStrLn "Not implemented"
225226 return ()
226227
228+------------------------------------------------------------------------------
229+-- FileIO
230+------------------------------------------------------------------------------
231+
232+makeFileIOGraphs :: Config -> String -> IO ()
233+makeFileIOGraphs cfg@Config{..} inputFile =
234+ ignoringErr $ graph inputFile "fileIO" cfg
235+
227236------------------------------------------------------------------------------
228237-- Reports/Charts for base streams
229238------------------------------------------------------------------------------
@@ -320,6 +329,11 @@ main = do
320329 makeNestedGraphs
321330 "charts/nested/results.csv"
322331 "charts/nested"
332+ FileIO -> benchShow opts cfg
333+ { title = Just "File IO" }
334+ makeFileIOGraphs
335+ "charts/fileio/results.csv"
336+ "charts/fileio"
323337 Base -> do
324338 let cfg' = cfg { title = Just "100,000 elems" }
325339 if groupDiff