@@ -4,6 +4,19 @@ Recommended GHC options are:
5 `-O2 -fspec-constr-recursive=10 -fmax-worker-args=16`
5 `-O2 -fspec-constr-recursive=10 -fmax-worker-args=16`
7+`-fspec-constr-recursive` is needed for better stream fusion by enabling
8+the `SpecConstr` optimization in more cases.
10+`-fmax-worker-args` is needed for better stream fusion by enabling the
11+`SpecConstr` optimization in some important cases.
13+In some cases, you may need to use `-funfolding-use-threshold` to make sure
14+that the combinators fuse. The default value of this option is `60`. Increasing
15+this default value can be detrimental in general, therefore, increase only if
16+you suspect an issue. As an example, a value of `75` is necessary and
17+sufficient to fuse `S.chunksOf n (A.writeN n)`. Hopefully GHC will fix this so
18+that it is not needed in future.
7At the very least `-O` compilation option is required. In some cases, the
20At the very least `-O` compilation option is required. In some cases, the
8program may exhibit memory hog with default optimization options. For example,
21program may exhibit memory hog with default optimization options. For example,
9the following program, if compiled without an optimization option, is known to
22the following program, if compiled without an optimization option, is known to
@@ -13,9 +26,6 @@ hog memory:
13main = S.drain $ S.concatMap S.fromList $ S.repeat []
26main = S.drain $ S.concatMap S.fromList $ S.repeat []
16−The `-fspec-constr-recursive=10` option may not be necessary in most cases but
17−may help boost performance in some cases.
19# Multi-core Parallelism
29# Multi-core Parallelism
21Concurrency without a threaded runtime may be a bit more efficient. Do not use
31Concurrency without a threaded runtime may be a bit more efficient. Do not use