-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/cmd/goimports: (unmerged CL version) slow resolution with large module cache #28518
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
Per discussions with @heschik offline, we've tracked down the issue. Now the repro (with fix applied): https://gist.github.com/myitcv/a9fcd3c7af7ef816711c83b300ea2a9d has the second set of Hence I'll close this and follow up in https://go-review.googlesource.com/c/tools/+/142697/ |
For posterity, the problem was that the scratch module's dependencies couldn't be resolved, but figuring that out took @bcmills, is the last sentence above something you'd expect? |
Just to correct one point; the module in which we were running Rather, I think the module cache was in a state that caused But per https://go-review.googlesource.com/c/tools/+/142697/#message-c2037823b2f2751007f352553e57b89a555374f2, I don't think we should even have hit the path of checking the module cache. |
Yeah, sorry, in this case the "scratch module" I was referring to is an internal implementation detail of go/packages, not your module. I'm replying to the code review comment on the code review. |
Ah I see, my bad. |
That is unexpected. |
NOTE: this issue relates to an unmerged CL.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
See repro script and output at: https://gist.github.com/myitcv/bbe8a91813e7a8fc5d2fc599013cf305
The general setup is:
"os/exec"
import (but otherwise would compile)goimports
and see that it resolves quicklygoimports
and see that it now resolves much more slowlyWhat did you expect to see?
Given the missing import is
"os/exec"
, a fastgoimports
resolution should be possible irrespective of the state of my module cache.What did you see instead?
A much slower
goimports
resolution with a large module cache: 7.5s vs 0.2s.cc @heschik
The text was updated successfully, but these errors were encountered: