go/internal/gcimporter
Alan Donovan 3c8152e28a internal/gcimporter: optimize dependency lookup
The old code based on packages.Visit traversed in a
deterministic order, and didn't stop when it found its
target (the 'return false' only prunes that subtree).
This CL replaces it with a precomputation of the
PkgPath-to-*Package mapping.

The performance difference is small for this test but
it nearly dominates on a larger input (e.g. k8s).
Example code shouldn't steer users into asymptotic traps.

Change-Id: I19f4fc2c25da3d2ae00090704df30a54d8516bf5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/447958
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-11-05 17:57:31 +00:00
..
testdata
bexport.go internal/gcimporter: API for shallow export data 2022-11-04 16:27:25 +00:00
bexport_test.go internal/gcimporter: API for shallow export data 2022-11-04 16:27:25 +00:00
bimport.go
exportdata.go
gcimporter.go
gcimporter_test.go
iexport.go internal/gcimporter: API for shallow export data 2022-11-04 16:27:25 +00:00
iexport_common_test.go
iexport_go118_test.go
iexport_test.go internal/gcimporter: API for shallow export data 2022-11-04 16:27:25 +00:00
iimport.go internal/gcimporter: API for shallow export data 2022-11-04 16:27:25 +00:00
israce_test.go
newInterface10.go
newInterface11.go
shallow_test.go internal/gcimporter: optimize dependency lookup 2022-11-05 17:57:31 +00:00
stdlib_test.go
support_go117.go
support_go118.go
unified_no.go
unified_yes.go
ureader_no.go
ureader_yes.go