on master help sign in
Add code (in benchmarks) to check fusion of parser ops
commita71f3b7e5b686e3433d5cc3457f75861ba79e5a6 authorHarendra Kumar <harendra@composewell.com> dateTue 28 Feb 2023, 07:22 (4 years ago) parent5be1d6e
1 file changed+12
benchmark/Streamly/Benchmark/Data/Parser.hs+12
benchmark/Streamly/Benchmark/Data/Parser.hs+12
@@ -1,5 +1,10 @@
11{-# OPTIONS_GHC -Wno-deprecations #-}
22
3+#undef FUSION_CHECK
4+#ifdef FUSION_CHECK
5+{-# OPTIONS_GHC -ddump-simpl -ddump-to-file -dsuppress-all #-}
6+#endif
7+
38-- |
49-- Module : Streamly.Benchmark.Data.Parser
510-- Copyright : (c) 2020 Composewell Technologies
@@ -551,6 +556,7 @@ o_n_heap_serial value =
551556
552557main :: IO ()
553558main = do
559+#ifndef FUSION_CHECK
554560 env <- mkHandleBenchEnv
555561 runWithCLIOptsEnv defaultStreamSize alloc (allBenchmarks env)
556562
@@ -567,3 +573,9 @@ main = do
567573 (o_1_space_serial_unfold value arrays)
568574 , bgroup (o_n_heap_prefix moduleName) (o_n_heap_serial value)
569575 ]
576+#else
577+ let value = 100000
578+ let input = sourceUnfoldrM value 1
579+ manyTill value input
580+ return ()
581+#endif