]> Cypherpunks repositories - gostls13.git/commit
cmd/go: always track visited packages in setPGOProfilePath
authorMichael Pratt <mpratt@google.com>
Fri, 26 May 2023 19:49:22 +0000 (15:49 -0400)
committerGopher Robot <gobot@golang.org>
Sat, 27 May 2023 00:39:39 +0000 (00:39 +0000)
commit3824d3d71ef1479b71ca624b728356657f62e1d3
tree52b33d29792f08bf7f72fba26e944bb082ecd67f
parent6e248b8ff2f387b5e4dd16a5b57f7487a2e18c94
cmd/go: always track visited packages in setPGOProfilePath

Currently we only track visited (copied) packages when a copy is
required. When a copy is not required, we will rewalk each package's
entire dependency graph every time we see it, which is terribly
inefficient.

Pull the visited package check up a level so that we visit packages only
once regardless of how many times they are visited.

Fixes #60455.
Fixes #60428.

Change-Id: I4e9b31eeeaa170db650c461a5de2ca984b9aba0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/498735
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
src/cmd/go/internal/load/pkg.go