on master help sign in
Add array benchmarks to charting/comparisons
3d32be5Harendra Kumar
bench.sh+2−2
@@ -2,7 +2,7 @@
2
2
3print_help () {
3print_help () {
4 echo "Usage: $0 "
4 echo "Usage: $0 "
5− echo " [--benchmarks <all|linear|linear-async|linear-rate|nested|fileio|base>]"
5+ echo " [--benchmarks <all|linear|linear-async|linear-rate|nested|fileio|array|base>]"
6 echo " [--group-diff]"
6 echo " [--group-diff]"
7 echo " [--graphs]"
7 echo " [--graphs]"
8 echo " [--no-measure]"
8 echo " [--no-measure]"
@@ -231,7 +231,7 @@ run_reports() {
231#-----------------------------------------------------------------------------
231#-----------------------------------------------------------------------------
232
232
233DEFAULT_BENCHMARKS="linear"
233DEFAULT_BENCHMARKS="linear"
234−ALL_BENCHMARKS="linear linear-async linear-rate nested fileio base"
234+ALL_BENCHMARKS="linear linear-async linear-rate nested fileio array base"
235GROUP_DIFF=0
235GROUP_DIFF=0
236
236
237COMPARE=0
237COMPARE=0
benchmark/Chart.hs+18−1
@@ -22,7 +22,14 @@ import BenchShow
22-- Command line parsing
22-- Command line parsing
23------------------------------------------------------------------------------
23------------------------------------------------------------------------------
24
24
25−data BenchType = Linear | LinearAsync | LinearRate | Nested | Base | FileIO
25+data BenchType
26+ = Linear
27+ | LinearAsync
28+ | LinearRate
29+ | Nested
30+ | Base
31+ | FileIO
32+ | Array
26 deriving Show
33 deriving Show
27
34
28data Options = Options
35data Options = Options
@@ -63,6 +70,7 @@ parseBench = do
63 Just "nested" -> setBenchType Nested
70 Just "nested" -> setBenchType Nested
64 Just "base" -> setBenchType Base
71 Just "base" -> setBenchType Base
65 Just "fileio" -> setBenchType FileIO
72 Just "fileio" -> setBenchType FileIO
73+ Just "array" -> setBenchType Array
66 Just str -> do
74 Just str -> do
67 liftIO $ putStrLn $ "unrecognized benchmark type " <> str
75 liftIO $ putStrLn $ "unrecognized benchmark type " <> str
68 mzero
76 mzero
@@ -233,6 +241,10 @@ makeFileIOGraphs :: Config -> String -> IO ()
233makeFileIOGraphs cfg@Config{..} inputFile =
241makeFileIOGraphs cfg@Config{..} inputFile =
234 ignoringErr $ graph inputFile "fileIO" cfg
242 ignoringErr $ graph inputFile "fileIO" cfg
235
243
244+makeArrayGraphs :: Config -> String -> IO ()
245+makeArrayGraphs cfg@Config{..} inputFile =
246+ ignoringErr $ graph inputFile "array" cfg
247+
236------------------------------------------------------------------------------
248------------------------------------------------------------------------------
237-- Reports/Charts for base streams
249-- Reports/Charts for base streams
238------------------------------------------------------------------------------
250------------------------------------------------------------------------------
@@ -334,6 +346,11 @@ main = do
334 makeFileIOGraphs
346 makeFileIOGraphs
335 "charts/fileio/results.csv"
347 "charts/fileio/results.csv"
336 "charts/fileio"
348 "charts/fileio"
349+ Array -> benchShow opts cfg
350+ { title = Just "Array" }
351+ makeArrayGraphs
352+ "charts/array/results.csv"
353+ "charts/array"
337 Base -> do
354 Base -> do
338 let cfg' = cfg { title = Just "100,000 elems" }
355 let cfg' = cfg { title = Just "100,000 elems" }
339 if groupDiff
356 if groupDiff