Open MangoIV opened 10 months ago
Unfortunately this is somewhat known, but we don't really know what the root cause of the issue is. At CircuitHub, we tend to set -O0
on modules that take a significant amount of time to compile. Can you try that and see if it helps at all? It's unlikely Rel8 modules really much from an optimization, afaik.
So I've encountered similar issues with compile times. It didn't really hit me until my application had to build via a CI pipeline, where it would slow to a halt and max out my memory budget. I was able to narrow the issue down to records that were deriving Generic
and Rel8able
and noticed it got slower with larger records. Removing all optimizations with -O0
also did the trick for me, however I wanted to figure out which optimizations in particular might be causing the problem. After a bit of trial and error I found that it had something to do with the interface files being generated by GHC. By adding just these two pragmas, -fomit-interface-pragmas
and -fignore-interface-pragmas
, while keeping all of the other optimizations, I was able to get my compile times down dramatically and resolve the memory leak.
With ghc9.4.6 the compile times for small modules are really high (multiple minutes), is this expected or might this be a regression in the compiler?