-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Build profiling libraries in 'haskellPackages' by default? #22340
Comments
This isn't really a community discussion, is it? Whoever is paying for Hydra can decide this unilaterally. Technically, it would probably be possible to modify GHC such that it would output both profiling and non-profiling in once pass, if anyone wanted to do any engineering on it, that is. |
I'm in two minds about this: At LumiGuide we use option 1. We care about small closure sizes since some of our machines are connected to the internet through mobile links with limited bandwidth. Although option 2 would be simpler and thus more user friendly which IMHO weighs more heavily than our specific requirements. So for me it's a +0.1 for option 2 and I hope #4504 will make progress. |
I believe that this is more a question of what the user wants, or rather what we want the user experience to be like. Whether Hydra will cope with the load or not is a subject of speculation. Nobody really knows and we're probably not going to get a definite answer to that question. IMHO, we should chose whatever the best solution is and then try it. |
At Takt we use a mixture of options 1 and 2. For all non-Takt code we use option 2, but then for our own code we use option 1 (in fact we go even further: We have a package set enabling optimizations for our packages, and another package set disabling them). This has worked quite well for us, because we only have to compile our dependencies once and they will satisfy the needs of any option 1 alternative we might want to use for our own code. With this in mind, I lean towards option 2, as I think it leads to a more rewarding stock experience for users. Those needing smaller closure sizes can tune these things a bit. By the way, besides setting
|
If we go with 2 plus multiple outputs, we can still get small closures |
Your own packages |
@ocharles I agree with your thoughts. This works well for our use case (although fortunately we don't need to do profiling very often!), but for |
|
Still a "please no" to that. That's a ton of information in |
Hmm... maybe this highlights a problem, then: Seeing as "enabling profile information" can mean different things depending on the flags passed to the compiler, does it make sense to provide a profiled Haskell package set at all if it won't satisfy the profiling needs of most people? |
The only reason I want a profiling set is so I can compile my code with
profiling. Ultimately, any called library code will show up in my own
profiling by making my own calls themselves slow. I profile with the
attitude of "vendor code is efficient, my code is inefficient". Only after
ruling out my own code as being problematic do I want to start seeing the
gory internals of other code. And even then I gradually opt in and work my
way "down the stack", so to speak.
…On Mon, 6 Feb 2017, 6:34 pm Renzo Carbonara, ***@***.***> wrote:
Hmm... maybe this highlights a problem, then: Seeing as "enabling profile
information" can mean different things (depending on the flags passed to
the compiler), does it make sense to provide a profiled Haskell package set
at all if it won't satisfy the profiling needs of most people?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22340 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABRjo0WwVvcRU58_P2iDoLblI4Bbm_Pks5rZ2fQgaJpZM4Lzth4>
.
|
@ocharles I can agree with that reasoning 👍 |
It's hard to decide which one solution is best. After some thought, I lean towards enabling profiling library builds by default in the upcoming Having profiling enabled by default gives more convenience to normal users, but it's a disadvantage for power users who want to create their own, minimal installations for production. Again, here I assume that those people know how to override the configuration in order to do exactly what they need. I'm sure this is not the best solution, but I can't think of any better one. |
Eh, I'm 👎 on release branches behaving differently that way. The "normal user" "git master user" distinction is not one we want to make bigger! |
OK, I suppose I won't enable profiling builds on |
I think option 2 is really the way to go for now. The main drawback is really going to be the increased closure size. @basvandijk highlights a concern here due to the link to deployment machines being a bottleneck, but I wonder - do you compile into a static binary? At CircuitHub we have found the smallest closure is to build a statically linked executable and then strip it. In this case, I'm not sure the inflation of profiling libraries would make a difference, and they would become a development-only cost. |
@ocharles at LumiGuide I recently wrapped all our Haskell executables in
So I don't have a problem anymore with option 2. |
If the profiling versions of libs can't be supplied by |
@peti does the recent multiple outputs stuff change things here? |
This will make a huge difference. Thanks for sorting this peti! |
It's very good that we now have profiled libraries available from the cache. No need to build our own profiled libraries anymore. Thanks peti! |
Oh interesting. So profiling will "just work" if |
Serious Haskell hackers need to profile their code, and that requires special variants of the libraries involved in the build. By default, we don't build those libraries. Should we? If we do, then I see the following options:
Provide separate package sets (e.g.
haskell.packages.ghcXYZ
andhaskell.packages.profiling.ghcXYZ
) and selectively enable both variants on hydra.nixos.org for appropriate compiler versions, i.e. for the default compiler that's used to buildhaskellPackages
, too. This means that users get the non-profiled package set by default, but they can switch to the profiled package set if they wish to do so.Pros:
Cons:
hydra.nixos.org
compile every library 5 times (static, dynamic in non-profiling package set, static, dynamic without profiling plus static with profiling in the profiling package set). This is going to slow down our builds, no doubt, and it's also doing to slow down other, non-Haskell builds.ghc
doesn't produce deterministic binaries across re-builds of the same code.We can enable profiling by default in our main package set,
haskellPackages
.Pros:
Cons:
cache.nixos.org
increase by a factor of ~1.5, too.Opinions?
The text was updated successfully, but these errors were encountered: