Skip to content

Unreasonably high memory use when compiling with profiling and -O2/-O2

Based on https://github.com/Daniel-Diaz/matrix/issues/43 I tried that myself.

  • Without profiling: <10 sec, <110M Residency
  • Profiling and -O: 90sec, 1.5GB Residency
  • Profiling and -O2: Killed it after 4 Minutes and it started swapping on a 16GB Ram machine.

The invocation was: ghc Matrix.hs -prof -fprof-auto -c -fforce-recomp -O -v -fprof-auto-exported -caf-all -auto-all -fstatic-argument-transformation

Numbers above from 8.0.2.

Edit: I messed up the meassurement somehow.

  1. 2.1 improved to ~70 sec and shy of 1GB ram usage. Not sure if that would still be considered a bug.
Edited by Andreas Klebinger
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information