cmd/go: go list does not scale with GOMAXPROCS #63136
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
ToolSpeed
Milestone
What version of Go are you using (
go version
)?master ace1494
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?
GOMAXPROCS=10 go list -json -m -u -mod=readonly -debug-trace=trace-default.txt all
GOMAXPROCS=20 go list -json -m -u -mod=readonly -debug-trace=trace-maxproc.txt all
The second command takes the same amount of time as the first one.
Here are the collected traces:
What did you expect to see?
The second command runs faster and scales, depending on the GOMAXPROCS value.
What did you see instead?
The second comment took the same amount of time as the first one.
Here are the collected traces:
trace-default.txt
trace-maxproc20.txt
From the traces, it's evident that the bottleneck is in getting the modules in a loop here:
https://github.com/golang/go/blob/ace1494d9235be94f1325ab6e45105a446b3224c/src/cmd/go/internal/modload/list.go#L277C1-L286C4
The text was updated successfully, but these errors were encountered: