Compiling Haskell is quite slow on Windows and as far as I can tell the two main culprits aren’t GHC.
- Windows Defender adds ~30% slowdown during most compilations fo rme
- Linking is glacial
The Windows Defender part can be fixed by by creating exceptions or disabling real-time protection.
But even without, linking really plays down incremental compilation. When recompiling a small-ish change in haskell-language-server
- compilation takes ~20s
- linking takes ~1:20
I’ve tried a bunch of combinations along the lines of
ghc-options: “-pgmP clang” “-pgmc clang” “-pgma clang” “-pgml clang” “-optl-fuse-ld=lld”
But this causes linking errors. Has anyone gotten other linkers to work on Windows? Ideally I’d love a config line I could drop into stack/cabal config files but at this point I’d be ecstatic about any information.