-
Notifications
You must be signed in to change notification settings - Fork 711
Cabal startup is slow #1841
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
Comments
That's an interesting observation. Since -v3 doesn't give you much, could you try with time profiling to see roughly what cabal is doing? |
Full profile: https://gist.github.com/08f25e0fa907e239be9f This is with current cabal master (d35bf72). |
Oh well, |
@dcoutts's new parser would probably help here. |
Correct me if I'm wrong, but the time is spent in parsing internal structures, not .cabal file. So some kind of efficient binary serialization seems to be the right solution. |
Yes, it may also be |
@nh2 Is the package that you're experiencing this with on Hackage? On my system, the no-op time is a bit faster (I tested with
|
@23Skidoo try this in a sandbox with many packages installed |
Then it's likely the |
Well...
|
I just tried with a larger sandbox (installed
|
Can you take a look at the full profile that I published above? It should point exactly to where the time is spent. |
Well, it does look like half of the time is spent in parsing
So the larger that file is (which depends on how many dependencies you have), the longer it should take. |
OK, I tested this theory, and the do-nothing
So the problem is inefficient parsing of |
Could |
Maybe. GHC ships with |
@23Skidoo GHC ships with @dcoutts @tibbe Any objections to |
@ttuegel not from my perspective. |
Fixed by #2076. Thanks to @feuerbach for helping to diagnose the problem and @ttuegel for actually writing the code. |
I just run the almost-noop command:
time cabal build asdf
What is cabal doing in these 4 seconds?
When I run
time cabal build asdf -v3
, I get the outputafter 2 seconds, and then the rest of the output after another 2 seconds.
I also noticed that this time seems to grow the longer I make the
build-depends
section in my cabal file.What is going on behind the scenes, and can we make this no-op time faster?
This startup time seems to add to all
cabal build
commands; it is especially painful for builds with nothing to do, where the penalty is quite high versus the actual time needed to compile: A no-op build only takes 6.8 seconds for me.The text was updated successfully, but these errors were encountered: