Speculative evaluation can cause a large increase in allocations
We've found that for `cardano-node` speculative evaluation introduced in the coreprep stage can cause a large increase in allocations. Some dictionaries get created a lot more because of this transformation.
I have a draft MR that allows speculative evaluation to be turned off (or turned off for `DFun`) https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13556 . Perhaps we can change the flag for `DFun` to one that sets an upper bound on the amount of allocation we do.
Speculative execution was added in: https://gitlab.haskell.org/ghc/ghc/-/issues/19224 / https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4833
issue