on master help sign in
Add array benchmarks to charting/comparisons
commit3d32be5acc71f115ef6d98a87928874e0f845ee4 authorHarendra Kumar <harendra.kumar@gmail.com> dateThu 8 Aug 2019, 10:46 (7 years ago) parent91f77f5
2 files changed+20−3
bench.sh+2−2 benchmark/Chart.hs+18−1
bench.sh+2−2
@@ -2,7 +2,7 @@
22
33print_help () {
44 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>]"
66 echo " [--group-diff]"
77 echo " [--graphs]"
88 echo " [--no-measure]"
@@ -231,7 +231,7 @@ run_reports() {
231231#-----------------------------------------------------------------------------
232232
233233DEFAULT_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"
235235GROUP_DIFF=0
236236
237237COMPARE=0
benchmark/Chart.hs+18−1
@@ -22,7 +22,14 @@ import BenchShow
2222-- Command line parsing
2323------------------------------------------------------------------------------
2424
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
2633 deriving Show
2734
2835data Options = Options
@@ -63,6 +70,7 @@ parseBench = do
6370 Just "nested" -> setBenchType Nested
6471 Just "base" -> setBenchType Base
6572 Just "fileio" -> setBenchType FileIO
73+ Just "array" -> setBenchType Array
6674 Just str -> do
6775 liftIO $ putStrLn $ "unrecognized benchmark type " <> str
6876 mzero
@@ -233,6 +241,10 @@ makeFileIOGraphs :: Config -> String -> IO ()
233241makeFileIOGraphs cfg@Config{..} inputFile =
234242 ignoringErr $ graph inputFile "fileIO" cfg
235243
244+makeArrayGraphs :: Config -> String -> IO ()
245+makeArrayGraphs cfg@Config{..} inputFile =
246+ ignoringErr $ graph inputFile "array" cfg
247+
236248------------------------------------------------------------------------------
237249-- Reports/Charts for base streams
238250------------------------------------------------------------------------------
@@ -334,6 +346,11 @@ main = do
334346 makeFileIOGraphs
335347 "charts/fileio/results.csv"
336348 "charts/fileio"
349+ Array -> benchShow opts cfg
350+ { title = Just "Array" }
351+ makeArrayGraphs
352+ "charts/array/results.csv"
353+ "charts/array"
337354 Base -> do
338355 let cfg' = cfg { title = Just "100,000 elems" }
339356 if groupDiff