mirror of https://github.com/golang/go.git
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> |
||
|---|---|---|
| .. | ||
| testdata | ||
| bexport.go | ||
| bexport_test.go | ||
| bimport.go | ||
| exportdata.go | ||
| gcimporter.go | ||
| gcimporter_test.go | ||
| iexport.go | ||
| iexport_common_test.go | ||
| iexport_go118_test.go | ||
| iexport_test.go | ||
| iimport.go | ||
| israce_test.go | ||
| newInterface10.go | ||
| newInterface11.go | ||
| shallow_test.go | ||
| stdlib_test.go | ||
| support_go117.go | ||
| support_go118.go | ||
| unified_no.go | ||
| unified_yes.go | ||
| ureader_no.go | ||
| ureader_yes.go | ||