on master help sign in
Use bench-graph to generate perf comparison charts
commit62ba37b7247a0287e3ec5586ca672a3d87fc834c authorHarendra Kumar <harendra.kumar@gmail.com> dateTue 10 Apr 2018, 11:51 (9 years ago) parent4272abd
3 files changed+68
benchmark/Charts.hs+38 stack.yaml+17 streamly.cabal+13
benchmark/Charts.hsnew file+38
@@ -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+ }
stack.yaml+17
@@ -1,9 +1,26 @@
11resolver: lts-11.0
22packages:
33- '.'
4+#- location: ../bench-graph
5+# extra-dep: true
46extra-deps:
57 - simple-conduit-0.6.0
68 - SDL-0.6.5.1
9+
10+ - git: https://github.com/composewell/bench-graph
11+ commit: dfabeaaa0f7c3ed3945e18cb6e2b2d0c03ae713f
12+
13+ - Chart-diagrams-1.8.3
14+ - SVGFonts-1.6.0.3
15+ - diagrams-core-1.4.0.1
16+ - diagrams-lib-1.4.2
17+ - diagrams-postscript-1.4
18+ - diagrams-svg-1.4.1.1
19+ - diagrams-solve-0.1.1
20+ - dual-tree-0.2.1
21+ - lens-4.15.4
22+ - free-4.12.4
23+
724flags: {}
825extra-package-dbs: []
926rebuild-ghc-options: true
streamly.cabal+13
@@ -224,6 +224,19 @@ benchmark benchOps
224224-- Examples
225225-------------------------------------------------------------------------------
226226
227+executable charts
228+ default-language: Haskell2010
229+ hs-source-dirs: benchmark
230+ main-is: Charts.hs
231+ if flag(dev)
232+ buildable: True
233+ build-Depends:
234+ base >= 4.8 && < 5
235+ , bench-graph
236+ , split
237+ else
238+ buildable: False
239+
227240executable loops
228241 default-language: Haskell2010
229242 main-is: loops.hs