Open wrl314 opened 8 years ago
The INLINE pragma on splitBlocks appears to be the culprit. Removing that inline allows profiling builds to finish.
So profiling builds do finish even without removing the splitBlocks inline pragma, but it took over an hour on an approx 1 year old Mac book pro.
Note that using stack build --profile --fast
works around the problem, but only when --fast comes after --profile. This disables inlining perhaps?
Seems to be a GHC Bug. I will open a Ticket there.
In the meantime switching from -O2 to -O1 for profiled builds helps a lot. (I assume it's one of the things --fast changes).
But even then the performance is unreasonably bad.
With both ghc 8.0.1 and ghc 7.10.2, compiling matrix with profiling enabled never finishes (or at least doesn't finish within 10 minutes or so).
To reproduce:
$ stack unpack matrix $ cd matrix-0.3.5.0 $ stack init $ stack build --profile
The non-profiled object file is built fine, but the profiled object file never finishes. ghc consuming 100% cpu until killed.
This is on a Mac running El Capitan.
Seems like this is a bug in GHC itself, but perhaps something in matrix is causing profiling to take exponential time? Any suggestions welcome.