File tree Expand file tree Collapse file tree 3 files changed +183
-112
lines changed Expand file tree Collapse file tree 3 files changed +183
-112
lines changed Original file line number Diff line number Diff line change 11module Main (main ) where
22
33import qualified Bench.Compact.Pure as Compact
4+ import Bench.Compact.SExpr
45import Test.Tasty.Bench (defaultMain )
6+ import System.Environment
7+ import Control.DeepSeq (rnf )
8+ import Control.Exception (evaluate )
59
6- -- Launch with
10+ -- Launch regular benchmark with
711-- stack bench linear-base:bench:memory --ba '+RTS -T'
812
13+ -- Profile parseWithoutDest with
14+ -- stack bench --library-profiling --executable-profiling --ghc-options '-fprof-late' linear-base:bench:memory --ba '+RTS -p -RTS runParseWithoutDest'
15+
16+ -- Profile parseUsingDest with
17+ -- stack bench --library-profiling --executable-profiling --ghc-options '-fprof-late' linear-base:bench:memory --ba '+RTS -p -RTS runParseUsingDest'
18+
919-- remove useless lines in profiling results with
1020-- .*?0\.0 0\.0 0\.0 0\.0\n
1121
22+ -- remove all lines with no individual contribution to alloc with
23+ -- .*?([0-9]+\.[0-9])\s+?0\.0\s+?([0-9]+\.[0-9])\s+([0-9]+\.[0-9])\n
24+
1225main :: IO ()
1326main = do
14- defaultMain
15- [ Compact. benchmarks
16- ]
27+ args <- getArgs
28+ case args of
29+ " runParseWithoutDest" : _ -> do
30+ sampleData <- loadSampleData
31+ let res = parseWithoutDest sampleData
32+ evaluate $ rnf $ res
33+ " runParseUsingDest" : _ -> do
34+ sampleData <- loadSampleData
35+ let res = parseUsingDest sampleData
36+ evaluate $ rnf $ res
37+ _ -> defaultMain
38+ [ Compact. benchmarks
39+ ]
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ module Compact.Pure
1212 pattern RegionContext ,
1313 withRegion ,
1414 Dest ,
15- fill ,
15+ Fill ( fill ) ,
1616 (<|) ,
1717 fillComp ,
1818 (<|.) ,
You can’t perform that action at this time.
0 commit comments