Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

does not finish compiling with profiling enabled #43

Open
wrl314 opened this issue Oct 7, 2016 · 3 comments
Open

does not finish compiling with profiling enabled #43

wrl314 opened this issue Oct 7, 2016 · 3 comments

Comments

@wrl314
Copy link

wrl314 commented Oct 7, 2016

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.

@wrl314
Copy link
Author

wrl314 commented Oct 7, 2016

The INLINE pragma on splitBlocks appears to be the culprit. Removing that inline allows profiling builds to finish.

@wrl314
Copy link
Author

wrl314 commented Oct 7, 2016

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?

@AndreasPK
Copy link
Contributor

AndreasPK commented Oct 21, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants