Skip to content

Commit 0658e91

Browse files
Use fusion-pugin and optimization options for the lib and exe
1 parent c636db9 commit 0658e91

1 file changed

Lines changed: 46 additions & 10 deletions

File tree

streamly-coreutils.cabal

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ extra-doc-files:
3636
, design/proposal.md
3737
, design/design-notes.md
3838

39+
flag fusion-plugin
40+
description: Use fusion plugin for best performance
41+
manual: True
42+
default: True
43+
3944
common compile-options
4045
default-language: Haskell2010
4146

@@ -98,8 +103,47 @@ common default-extensions
98103
-- UndecidableInstances -- Does not show any perf impact
99104
-- UnboxedTuples -- interferes with (#.)
100105

106+
common exe-dependencies
107+
build-depends:
108+
base
109+
, optparse-applicative >= 0.17 && < 0.19
110+
, streamly
111+
, streamly-core
112+
, streamly-coreutils
113+
114+
common perf-options
115+
ghc-options: -O2
116+
-fdicts-strict
117+
-fspec-constr-recursive=16
118+
-fmax-worker-args=16
119+
-Wall
120+
-Wcompat
121+
-Wunrecognised-warning-flags
122+
-Widentities
123+
-Wincomplete-record-updates
124+
-Wincomplete-uni-patterns
125+
-Wredundant-constraints
126+
-Wnoncanonical-monad-instances
127+
if impl(ghc >= 9.8)
128+
ghc-options: -Wno-x-partial
129+
130+
if flag(fusion-plugin)
131+
ghc-options: -fplugin Fusion.Plugin
132+
build-depends:
133+
fusion-plugin >= 0.2.6 && < 0.3
134+
135+
common exe-options
136+
import: exe-dependencies, perf-options
137+
default-language: Haskell2010
138+
hs-source-dirs: app
139+
140+
common exe-options-threaded
141+
import: exe-options
142+
ghc-options: -threaded
143+
-with-rtsopts=-N
144+
101145
library
102-
import: compile-options, default-extensions
146+
import: compile-options, default-extensions, perf-options
103147
build-depends:
104148
base >= 4.8 && < 5
105149
, directory >= 1.2.2 && < 1.4
@@ -155,16 +199,8 @@ library
155199
default-language: Haskell2010
156200

157201
executable hfd
158-
import: compile-options, default-extensions
202+
import: compile-options, default-extensions, exe-options-threaded
159203
main-is: hfd.hs
160-
hs-source-dirs: app
161-
build-depends:
162-
base
163-
, optparse-applicative >= 0.17 && < 0.19
164-
, streamly
165-
, streamly-core
166-
, streamly-coreutils
167-
default-language: Haskell2010
168204

169205
-------------------------------------------------------------------------------
170206
-- Benchmarks

0 commit comments

Comments
 (0)