Exponential Core generation regression in GHC 9.4
We recently upgraded to GHC 9.4.5 at work (from 9.2). This in general has improved compile times, but one of the modules has regressed badly. It used to compile quickly but now takes 88s.
It features a large record type with a hand-written FromJSON
instance.
My suspicion is that some change in the optimiser is leading to Core exponential in the amount of fields.
I've uploaded a pared down reproducer here: https://gitlab.haskell.org/teo/aeson-exponential-code-repro . Unfortunately it still depends on aeson, so it is quite heavy.
You should be able to build it by running:
nix develop
cabal build
I've tried building this with a few different versions of GHC and this is what I get:
GHC version | time taken (s) | -dump-simpl size (bytes) |
---|---|---|
9.2.7 | 3s | 553K |
9.4.5 | 34s | 48M |
9.6.1 | 25s | 48M |