What version of Go are you using (go version
)?
master ace1494d9235be94f1325ab6e45105a446b3224c
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GOARCH='arm64' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOOS='darwin'
What did you do?
- Clone Kubernetes
- Run
GOMAXPROCS=10 go list -json -m -u -mod=readonly -debug-trace=trace-default.txt all
- Run
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
Comment From: gopherbot
Change https://go.dev/cl/530037 mentions this issue: cmd/go: scale go list with GOMAXPROCS
Comment From: dany74q
Any update on this one ? It makes life much better for large multi-module mono-repos
Comment From: goto1134
@dany74q , the next step is to provide benchmarks. I want to do it sometime later. Probably in November.
I hope this change will be accepted for the February release of Go.
Comment From: AdallomRoy
@goto1134 any updates on this?
Comment From: goto1134
@AdallomRoy, the PR is still being reviewed and waiting for me to revisit the performance tests after the latest review comments. It's my next task on the list 🙂
Comment From: AdallomRoy
@goto1134 any updates on this? it's been another month and performance is still abysmal.
Comment From: goto1134
@goto1134 any updates on this? it's been another month and performance is still abysmal.
Hey, @AdallomRoy ! As you might see, I provided all the changes requested by reviewers. Could you clarify how I can help you?
Comment From: gopherbot
Change https://go.dev/cl/608135 mentions this issue: cmd/go: add benchmark for go list -m