on master help sign in
Add -funfolding-use-threshold GHC option

update the optimization options' description.

commitbca03590a806653a4019a9b44d6b85e6dd41aeb3 authorHarendra Kumar <harendra.kumar@gmail.com> dateSun 25 Aug 2019, 12:40 (7 years ago) parent1b8439d
1 file changed+13−3
docs/Build.md+13−3
docs/Build.md+13−3
@@ -4,6 +4,19 @@ Recommended GHC options are:
44
55 `-O2 -fspec-constr-recursive=10 -fmax-worker-args=16`
66
7+`-fspec-constr-recursive` is needed for better stream fusion by enabling
8+the `SpecConstr` optimization in more cases.
9+
10+`-fmax-worker-args` is needed for better stream fusion by enabling the
11+`SpecConstr` optimization in some important cases.
12+
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.
19+
720At the very least `-O` compilation option is required. In some cases, the
821program may exhibit memory hog with default optimization options. For example,
922the following program, if compiled without an optimization option, is known to
@@ -13,9 +26,6 @@ hog memory:
1326main = S.drain $ S.concatMap S.fromList $ S.repeat []
1427```
1528
16−The `-fspec-constr-recursive=10` option may not be necessary in most cases but
17−may help boost performance in some cases.
18−
1929# Multi-core Parallelism
2030
2131Concurrency without a threaded runtime may be a bit more efficient. Do not use