-
Notifications
You must be signed in to change notification settings - Fork 842
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 exec is unreasonably slow #1883
Comments
Yes, it would be great if the performance could be improved. |
I've annotated the log with some notes:
So, about 3/5 of the time is being spent decoding the hackage index, which isn't being used. It's tricky to do anything about the remaining 2/5, because in order to populate the PATH env var, we need to know the ghc and cabal version being used. For system installations managed by stack, we could trust that the version is accurate - we're still asking ghc for its version in that case. You'll save something like 0.06s by doing |
I've pushed a commit which only loads up the hackage index when necessary. Now it takes 50% less time or so! There's still some work to do here, but not relevant to |
@mgsloan This is a huge improvement! Thanks a lot. It’s now below the point where it starts to be painful for me, so feel free to close this if there is no way to improve it further (with reasonable effort). |
Welcome, glad it's below the point of being painful! Yeah, I think optimizing it further is more effort than it's worth at this point. I've written down a misc TODO note to maybe revisit the ghc version checking stuff for stack installed ghcs. |
I primarily use
stack exec
to execute the executables I have just built. In the vast majory of cases (probably also for other people) allstack exec
needs to do is set thePATH
correctly since my executables don’t depend on any other settings. However the overheadstack exec
adds has slowly grown to the point where it becomes annoying:vs
I realize that to completely set up the environment
stack exec
has to do more than just set the path correctly but if that causes such a drastic slowdown, could we get a--fast
(probably needs a better name) option for the common case where it just needs to set the path?The text was updated successfully, but these errors were encountered: