-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go list
commands called by golang.org/x/tools/go/packages.Load()
varies from ~500ms to 3s with no other changes
#63863
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
go list
commands called by golang.org/x/tools/go/packages.Load()
varies from ~500ms to 3s with no other changesgo list
commands called by golang.org/x/tools/go/packages.Load()
varies from ~500ms to 3s with no other changes
I don't see any code for reproducing this? |
There's a link to a playground with the code. Running it against it itself reproduces it, or any project. |
the playground link is just output, no code |
Ah my apologies, I pasted the wrong link. Updated the description, but it's also here. |
Even 500ms seems quite slow, is it perhaps a macos issue or some other antivirus software you have running? |
On macOS in particular, I wonder if this is yet another symptom of #63937. 🤔 |
80ms or more to run |
I do indeed think this is something on my Mac. I tried it in a completely clean directory and couldn't replicate it, so it must be something local. Apologies for the noise. |
To be clear: we are definitely interested in addressing this sort of problem, if we can figure out where the delays are coming from. (But the space of “possible sources of delay” is unfortunately very large, and our resources for investigating are limited. 😅) |
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
)?go env
OutputWhat did you do?
Repeated runs of
golang.org/x/tools/go/packages.Load()
vary wildly in their duration on the same small package, with no changes in between runs.The code for the example below is here.
Strangely, setting
GOMAXPROCS=1
significantly increases the likelihood of the time blowing out.Here's output of me running the same command repeatedly. Notice that sometimes it takes 2+ seconds in total, but sometimes takes only ~500ms.
Example output:
What did you expect to see?
I would expect the command to take roughly the same time on each run.
What did you see instead?
It varies significantly. Most of the time it takes around ~500ms, but sometimes it spikes up to 2s and even 3s on occasion.
The text was updated successfully, but these errors were encountered: