On Sat, Jul 29, 2023 at 2:44 AM Ilias Tsitsimpis <[email protected]> wrote: > > On Fri, Jul 28, 2023 at 05:09PM, Jeffrey Walton wrote: > > Break that source file up into two or three more manageable pieces. > > > > If I am parsing the command line correctly, the source file is > > Instances.hs and the output file is Instances.p_o. I would try to > > create Instances_1.hs, Instances_2.hs and Instances_3.hs, and then let > > the linker combine their object files later. > > > > What I don't know is, is it possible to do that in Haskell. Some > > languages are picky about things like that. C# and Java come to mind. > > This was suggested as a solution by upstream as well (see [1]) but they > found it was too difficult to do and ended up using to -O0 instead. > > [1] https://gitlab.haskell.org/ghc/ghc/-/issues/18256
The 18256 issue looks like it is a different complaint. 18256 tries to speed up compile time. An OOM kill is a different problem. Looking at the original command, the project is using -O, which is -O2. Maybe you can drop it to -O1 -fno-inline. >From Crypto++, I've found there's no material difference between -O1, -O2 or -O3. Crypto++ provides SSE/AVX/NEON/ASIMD/Altivec acceleration where it matters, so compiler optimizations make almost no difference at runtime according to benchmarks. I see Debian has https://wiki.debian.org/ReduceBuildMemoryOverhead, but it does not look too helpful. (I updated with your discussion).

