Skip to content

Commit

Permalink
Remove redundant imports and control CPP via cabal flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Adithya Obilisetty committed Feb 5, 2024
1 parent b6d9730 commit 32965bc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
22 changes: 21 additions & 1 deletion haskell-perf.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions lib/Stat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions stat-collector-src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,23 @@ 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)
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

Expand All @@ -53,7 +45,6 @@ double = fromIntegral
-- Types
--------------------------------------------------------------------------------

type NameSpace = String
type ModuleName = String
type LineNum = Int32
type PointId = (ModuleName, LineNum)
Expand Down

0 comments on commit 32965bc

Please sign in to comment.