on master help sign in
Update the compilation guide for new release
311cb23Harendra Kumar
docs/User/HowTo/Compiling.md+21−35
@@ -4,18 +4,8 @@
4
4
5### Compiler (GHC) Versions
5### Compiler (GHC) Versions
6
6
7−GHC 8.6 and above are recommended. For best performance use GHC 8.8 or
7+Do not use ghc 9.0.x and 9.2.1. For best performance use
8−8.10 along with `fusion-plugin` (see below). Benchmarks show that GHC
8+`fusion-plugin` (see below) when compiling.
9−8.8 has significantly better performance than GHC 8.6 in many cases.
10−
11−GHC 9.0 and GHC 9.2.1 have some performance issues, please see [this
12−issue](https://github.com/composewell/streamly/issues/1061) for details.
13−GHC 9.2.2 is expected to have the fixes that will bring the performance on par
14−with previous versions.
15−
16−### Distributions
17−
18−Tested with stackage `lts-18.27` and `nix 21.05`.
19
9
20### Memory requirements
10### Memory requirements
21
11
@@ -23,10 +13,10 @@ Building streamly itself may require upto 4GB memory. Depending on the
23size of the application you may require 1-16GB memory to build. For most
13size of the application you may require 1-16GB memory to build. For most
24applications up to 8GB of memory should be sufficient.
14applications up to 8GB of memory should be sufficient.
25
15
26−To reduce the memory footprint you may want to break big modules into
16+To reduce the memory footprint you may want to break big modules
27−smaller ones and reduce unnecessary inlining on large functions. You can
17+into smaller ones and reduce unnecessary INLINE pragmas on large
28−also use the `-Rghc-timing` GHC option to report the memory usage during
18+functions. You can also use the `-Rghc-timing` GHC option to report the
29−compilation.
19+memory usage during compilation.
30
20
31See the "Build times and space considerations" section below for more
21See the "Build times and space considerations" section below for more
32details.
22details.
@@ -46,23 +36,19 @@ the cabal file and use the following GHC options:
46 -fplugin Fusion.Plugin
36 -fplugin Fusion.Plugin
47```
37```
48
38
39+See [Explanation](#explanation) section below for details about these flags.
40+
49Important Notes:
41Important Notes:
50
42
511. [fusion-plugin](https://hackage.haskell.org/package/fusion-plugin) can
431. [fusion-plugin](https://hackage.haskell.org/package/fusion-plugin) can
52− improve performance significantly by better stream fusion, many
44+ improve performance significantly by better stream fusion, in many
53− cases. If the perform regresses due to fusion-plugin please open
45+ cases. If the performance regresses due to fusion-plugin please open
54 an issue. You may remove the `-fplugin` option for regular builds
46 an issue. You may remove the `-fplugin` option for regular builds
55 but it is recommended for deployment builds and performance
47 but it is recommended for deployment builds and performance
56− benchmarking. Note, for GHC 8.4 or lower fusion-plugin cannot be used.
48+ benchmarking.
572. In certain cases it is possible that GHC takes too long to compile
492. In certain cases it is possible that GHC takes too long to compile
58 with `-fspec-constr-recursive=16`, if that happens please reduce the
50 with `-fspec-constr-recursive=16`, if that happens please reduce the
59 value or remove that option.
51 value or remove that option.
60−3. At the very least `-O -fdicts-strict` compilation options are
61− absolutely required to avoid issues in some cases. For example, the
62− program `main = S.drain $ S.concatMap S.fromList $ S.repeat []` may
63− hog memory without these options.
64−
65−See [Explanation](#explanation) for details about these flags.
66
52
67#### Explanation
53#### Explanation
68
54
@@ -70,19 +56,19 @@ See [Explanation](#explanation) for details about these flags.
70issue](https://gitlab.haskell.org/ghc/ghc/issues/17745) leading to
56issue](https://gitlab.haskell.org/ghc/ghc/issues/17745) leading to
71memory leak in some cases.
57memory leak in some cases.
72
58
73−* `-fspec-constr-recursive` is needed for better stream fusion by enabling
59+* `-fspec-constr-recursive` is needed for better stream fusion, it
74−the `SpecConstr` optimization in more cases. Large values used with this flag
60+allows the `SpecConstr` optimization to occur in more cases. Large
75−may lead to huge compilation times and code bloat, if that happens please avoid
61+values used with this flag may lead to huge compilation times and code
76−it or use a lower value (e.g. 3 or 4).
62+bloat, if that happens please avoid it or use a lower value (e.g. 3 or
63+4).
77
64
78−* `-fmax-worker-args` is needed for better stream fusion by enabling the
65+* `-fmax-worker-args` is needed for better stream fusion, it allows the
79−`SpecConstr` optimization in some important cases.
66+`SpecConstr` optimization to occur in some important cases.
80
67
81* `-fplugin=Fusion.Plugin` enables predictable stream fusion
68* `-fplugin=Fusion.Plugin` enables predictable stream fusion
82optimization in certain cases by helping the compiler inline internal
69optimization in certain cases by helping the compiler inline internal
83−bindings and therefore enabling case-of-case optimization. In some
70+bindings, therefore, enabling case-of-case optimization. In some cases,
84−cases, especially in some file IO benchmarks, it can make a difference of
85−5-10x better performance.
71+it can make a difference of 5-10x better performance.
86
72
87### Multi-core Parallelism
73### Multi-core Parallelism
88
74
@@ -121,7 +107,7 @@ more details.
121
107
122### Nix build
108### Nix build
123
109
124−Please note that cabal2nix may not always be able to generate a complete nix
110+Please note that `cabal2nix` may not always be able to generate a complete nix
125expression on `macOS`. See [this
111expression on `macOS`. See [this
126issue](https://github.com/NixOS/cabal2nix/issues/470).
112issue](https://github.com/NixOS/cabal2nix/issues/470).
127
113