Remove INLINE pragma for default implementations of Store methods #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #91 (and in https://ghc.haskell.org/trac/ghc/ticket/13059),
store
appeared to take much more memory to compile between GHC 8.0.1 and 8.0.2, jumping from 1.6 GB to 5.17 GB. I finally nailed down why this seemed to appear only in GHC 8.0.2 in https://ghc.haskell.org/trac/ghc/ticket/13059#comment:20. I encourage you to read that if you are curious, but the tl;dr version is that GHC 8.0.1 and earlier incorrectly droppedINLINE
pragmas for default method implementations, and when 8.0.2 fixed this bug, it dramatically increased the amount of inlining that happens instore
, causing the memory spike.We can at least go back to the "status quo" of GHC 8.0.1 and earlier by removing the
INLINE
pragmas for the default implementations ofStore
's class methods, which restores the maximum residency to about 1.6 GB for both GHC 8.0.1 and 8.0.2.Of course, you might be concerned that this could impact performance - just in case, I ran the
store
benchmarks with and without this change on a 4-core, 64-bit Linux desktop with 16 GB of RAM.Here are the results before this PR:
Here are the results after this PR:
It doesn't appear that different to my (admittedly untrained) eye.
Fixes #91.