-
Notifications
You must be signed in to change notification settings - Fork 81
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
Profiling is unecessary slow #438
Comments
I'm still not able to generate a small reproducible example, but I now have a lot of question related to the implementation of So, rules_haskell fails building some targets in the following context:
When experimenting, I found that removing the
I've tried the same change in rules_haskell codebase and the result is surprising. There are two ways to build with profiling using ghc and TemplateHaskell, For example, this experimentation (with only one module, in this case the two phases build is not really necessary, but will be for more modules).
Build without profiling:
Failure with just
(Note how it discusses the two solutions) First solution with
(This build command takes 30s on my computer) Second solution, with the two builds:
This solution takes 2s to build.
Now I have many discussions points to direct my work. Currently, rules_haskell uses
rules_haskell/haskell/private/haskell_impl.bzl Lines 66 to 107 in f7b355a
The be5cf67#diff-33a8c46955e2a9917090b5258346aee2R205 @mrkkrp could you comment please? There is two possible directions:
Both solutions have pro and cons, mostly:
cc @mboes |
Note that cabal uses the "two step" build solution. I changed title's issue to reflect the current discussion. I should have created this discussion in a new issue. |
Progress notes:
|
Nice writeup, but I'm failing to understand what the objective of this ticket is. The title of the ticket says profiling is "slow". But the description says there's some build error somewhere (but no repro). Which problem are you trying to solve? |
What I'm trying to solve:
Considering that the GHC linking bug won't be fixed soon (in a released GHC version), the slowdown of |
There's a lot of good discussion in the comments here, but they read as a journal of incremental discoveries, so it's hard to follow. Meanwhile the ticket description is still... very minimal. @guibou could you summarize your findings in an updated ticket description? |
ping @guibou |
I've updated the ticket description and I'm closing as won't fix. Rational: there is two way to fix this issue:
|
Actually, I'm reopening it. Profiling is still slow, even if we did choose to keep the slow implementation, the problem is still there. |
There is no more details in the upstream ticket, but the problem seems to be fixed starting ghc 8.8. https://gitlab.haskell.org/ghc/ghc/issues/16256 Now the issue is linked to #1323 . |
https://gitlab.haskell.org/ghc/ghc/issues/14335 ghc plugins are not working with |
This is an updated description which summarize the discussion
-c dbg
is really slow when template haskell is used because we use-fexternal-interpreter
and this GHC bug: https://ghc.haskell.org/trac/ghc/ticket/16256#ticket . In summary, profiling build is 15x times slower than normal build.-fexternal-interpreter
, which is now used in rules_haskell, and another solution which build two times, once without profiling (so template haskell can execute non profiled code) and one with profiling.-fexternal-interpreter
was accidentally done in be5cf67#diff-33a8c46955e2a9917090b5258346aee2R205. Since Drop non-profiling inputs to profiling build #892 the dead code of the two build solution was removed.We have two solution here:
-fexternal-interpreter
and wait for an upstream fix for GHC-fexternal-interpreter
and reimplement the two steps build.The text was updated successfully, but these errors were encountered: