@@ -0,0 +1,38 @@
1+{-# LANGUAGE TupleSections #-}
2+module Main where
3+
4+import Data.List
5+import Data.List.Split
6+import BenchGraph (bgraph, defaultConfig, Config(..), ComparisonStyle(..))
7+import Control.Applicative ((<|>))
8+
9+main :: IO ()
10+main = do
11+ let cfg = defaultConfig
12+ { outputDir = "charts"
13+ , comparisonStyle = CompareDelta
14+ }
15+
16+ -- bgraph <input> <output> <field in csv file to be plotted>
17+ -- other interesting fields to plot are:
18+ -- allocated
19+ -- bytesCopied
20+ -- mutatorCpuSeconds
21+ -- gcCpuSeconds
22+ bgraph "charts/results.csv" "operations" "time" $ cfg
23+ { chartTitle = Just "Streamly operations (time)"
24+ , classifyBenchmark = \b ->
25+ if "compose" `isPrefixOf` b || "/concat" `isSuffixOf` b
26+ then Nothing
27+ else Just ("Streamly", last $ splitOn "/" b)
28+ }
29+
30+ bgraph "charts/results.csv" "composition" "time" $ cfg
31+ { chartTitle = Just "Streamly composition performance (time)"
32+ , classifyBenchmark = fmap ("Streamly",) . stripPrefix "compose/"
33+ }
34+
35+ bgraph "charts/results.csv" "composition-scaling" "time" $ cfg
36+ { chartTitle = Just "Streamly composition scaling (time)"
37+ , classifyBenchmark = fmap ("Streamly",) . stripPrefix "compose-"
38+ }