haskellari / lattices

Fine-grained lattice primitives for Haskell
BSD 3-Clause "New" or "Revised" License
35 stars 15 forks source link

Compiling the testsuite with GHC 8.10.2 and optimisations takes a huge amount of memory #105

Closed sgraf812 closed 3 years ago

sgraf812 commented 3 years ago

In a nix build I realised that compiling the testsuite takes huge amounts of memory (~6GB) and time (~2 minutes). I suspect the inliner is at fault, but you could probably compensate by attaching NOINLINEs to allLatticeLaws and friends. Maybe this is fixed in GHC 8.10.3 (https://gitlab.haskell.org/ghc/ghc/-/issues/18140), otherwise this is a GHC bug.

Or even simpler suggestion: {-# GHC_OPTIONS -O0 #-}. There shouldn't be much opportunity for optimisation anyway, or at least the time spent optimising will probably be longer than running the test suite once.

phadej commented 3 years ago

Do you mind making a PR, adding {-# NOINLINE #-} (after checking that it fixes your issue).

I don't like slapping -O0 for whole module.

phadej commented 3 years ago

Resolved by #106 / #108