on d59ff9d help sign in
streamly/benchmark/ChartNested.hs
46 lines 1.5 kB history raw
1{-# LANGUAGE TupleSections #-}
2{-# LANGUAGE ScopedTypeVariables #-}
4module Main where
6import Data.List
7import Data.List.Split
8import BenchGraph (bgraph, defaultConfig, Config(..), ComparisonStyle(..))
9import Control.Exception (handle, catch, SomeException, ErrorCall)
11main :: IO ()
12main = do
13 let cfg = defaultConfig
14 { outputDir = "charts"
15 , comparisonStyle = CompareFull
16 }
18 ignoringErr a = catch a (\(_ :: ErrorCall) ->
19 putStrLn "Failed. Skipping.")
20 -- bgraph <input> <output> <field in csv file to be plotted>
21 -- other interesting fields to plot are:
22 -- allocated
23 -- bytesCopied
24 -- mutatorCpuSeconds
25 -- gcCpuSeconds
26 ignoringErr $ bgraph "charts/results.csv" "nested-ops" "time" $ cfg
27 { chartTitle = Just "Nested operations (time)"
28 , classifyBenchmark = \b ->
29 let ls = splitOn "/" b
30 in case head ls of
31 "linear" -> Nothing
32 _ -> Just (head ls, last ls)
33 , sortBenchmarks = nub
34 , comparisonStyle = CompareFull
35 }
37 ignoringErr $ bgraph "charts/results.csv" "nested-serial-comparative" "time" $ cfg
38 { chartTitle = Just "Nested serial comparative (time)"
39 , classifyBenchmark = \b ->
40 let ls = splitOn "/" b
41 in case head ls of
42 "streamly" -> Just (head ls, last ls)
43 _ -> Nothing
44 , sortBenchmarks = nub
45 , comparisonStyle = CompareDelta
46 }