Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack --profile shouldn't force --ghc-options='-auto-all' #2853

Open
robsmith11 opened this issue Dec 16, 2016 · 6 comments
Open

stack --profile shouldn't force --ghc-options='-auto-all' #2853

robsmith11 opened this issue Dec 16, 2016 · 6 comments

Comments

@robsmith11
Copy link

robsmith11 commented Dec 16, 2016

I want to use only manual cost centers when profiling, but it appears that stack is forcing --ghc-options='-auto-all' whenever profiling is enabled. Even if I pass --ghc-options='-fno-prof-auto', the auto cost center are still used.

@robsmith11 robsmith11 reopened this Dec 17, 2016
@mgsloan mgsloan added this to the P3: Optional milestone Dec 17, 2016
@robsmith11
Copy link
Author

Do you know of any easy workaround? I'm trying to profile my application, but the auto cost centers in vector break the critical fusion optimization making profiling unusable.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 1, 2017

Not exactly an "easy" workaround, but one temporary option might be to compile stack with the -auto-all stuff removed.

I'm surprised that --ghc-options='-fno-prof-auto' doesn't do the trick. Perhaps we will need to provide a --profile-no-auto flag?

@duog
Copy link

duog commented Nov 21, 2017

I'm running into this now. The issue seems to be that stack passes -auto-all and -auto-cafs AFTER manually specified ghc-options, so I'm unable to override it with -fno-prof-auto etc.

@tirumaraiselvan
Copy link

Hi, any plans to work further on this issue?

@tuomohopia
Copy link

I'm guessing this isn't seeing any progress anymore.

Did anyone come up with any working workaround? Would hate to have to move to cabal just because of this.

@DouglasRaillard
Copy link

DouglasRaillard commented Oct 19, 2020

Hi, +1 on the issue, passing --ghc-options=-fno-prof-auto does not seem to do the trick, making the actual information I'm looking for lost in the noise (and quite likely completely transformed, the runtime jumps from 6 seconds to ~45s when enabling profiling).
For some reason, it even seems to profile >>= from attoparsec Zepto type, even though it's marked as inline.

EDIT: for future reference, the solution from this article seems to work:
https://www.tweag.io/blog/2020-01-30-haskell-profiling/
Use this in stack.yaml:

apply-ghc-options: everything
rebuild-ghc-options: true

And then rebuild with appropriate profiling options. This will rebuild all dependencies and apply the options you chose.

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

No branches or pull requests

6 participants