diff --git a/haskell-perf.cabal b/haskell-perf.cabal index 3e3908a..0d9e3f7 100644 --- a/haskell-perf.cabal +++ b/haskell-perf.cabal @@ -34,6 +34,11 @@ flag dev manual: True default: False +flag prim-op + description: Prim-op is available + manual: True + default: False + flag fusion-plugin description: Use fusion plugin for benchmarks and executables manual: True @@ -104,6 +109,8 @@ common compile-options ghc-options: -Wmissed-specialisations -Wall-missed-specialisations -fno-ignore-asserts + if flag(prim-op) + cpp-options: -DPRIM_OP_AVAILABLE library import: compile-options @@ -137,7 +144,20 @@ executable stat-collector build-depends: base , streamly-core - , streamly + , containers + , format-numbers + , text + , haskell-perf + +test-suite stat-test + import: compile-options + type: exitcode-stdio-1.0 + hs-source-dirs: test + main-is: Main.hs + ghc-options: -O2 -fmax-worker-args=16 -fspec-constr-recursive=16 + build-depends: + base + , streamly-core , containers , format-numbers , text diff --git a/lib/Stat.hs b/lib/Stat.hs index bbc4309..3807313 100644 --- a/lib/Stat.hs +++ b/lib/Stat.hs @@ -42,9 +42,6 @@ import qualified Streamly.Internal.Data.MutByteArray as MBA import Prelude import Language.Haskell.TH -#define PRIM_OP_AVAILABLE --- #undef PRIM_OP_AVAILABLE - #ifdef PRIM_OP_AVAILABLE import GHC.Exts (threadCPUTime#) #else diff --git a/stat-collector-src/Main.hs b/stat-collector-src/Main.hs index 39188aa..b8a8672 100644 --- a/stat-collector-src/Main.hs +++ b/stat-collector-src/Main.hs @@ -12,7 +12,6 @@ import Data.Int (Int32, Int64) import System.Environment (getArgs) import Data.Function ((&)) import Data.List (foldl', uncons) -import Data.Char (ord) import Data.Map (Map) import Data.Maybe (fromJust) import Data.Word (Word8) @@ -20,23 +19,16 @@ import Streamly.Data.Array (Array) import Streamly.Data.Fold (Fold) import Streamly.Data.Stream (Stream) import Streamly.Internal.Data.Fold (Fold(..), Step(..)) -import Streamly.Data.ParserK (ParserK) import Streamly.Unicode.String (str) import System.IO (stdin) import Data.Text.Format.Numbers (prettyI) -import Control.Exception - (catch, SomeException, displayException, throwIO, ErrorCall(..)) -import qualified Streamly.Internal.Data.StreamK as StreamK (unfoldrM) import qualified Data.Text as Text import qualified Data.Map as Map import qualified Streamly.Data.Fold as Fold import qualified Streamly.Data.Parser as Parser -import qualified Streamly.Data.ParserK as ParserK import qualified Streamly.Data.Stream as Stream -import qualified Streamly.Data.StreamK as StreamK import qualified Streamly.FileSystem.Handle as Handle -import qualified Streamly.Unicode.Stream as Unicode import qualified Streamly.Internal.Data.Array as Array import qualified Streamly.Internal.Data.Binary.Parser as Parser @@ -53,7 +45,6 @@ double = fromIntegral -- Types -------------------------------------------------------------------------------- -type NameSpace = String type ModuleName = String type LineNum = Int32 type PointId = (ModuleName, LineNum)