-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/go/packages: LoadSyntax performance after LoadMode option split into Need constants #31930
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
andybons
added
the
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
label
May 13, 2019
jirfag
added a commit
to golangci/tools
that referenced
this issue
Sep 9, 2019
Before separating Load* into Need* we could use LoadSyntax to get types information by loading inital packages from source code and loading it's direct dependencies from export data. It was broken when separation was introduced and before this commit everything was loading from source code what resulted into slow loading times. This commit fixes it. Also, do backwards-incompatible fix of definition of deprecated LoadImports and LoadAllSyntax. Improve an internal error message "internal error: nil Pkg importing x from y": replace it with "internal error: package x without types was imported from y". Remove packages.NeedDeps request for loading in tests TestLoadTypesBits and TestContainsOverlayXTest. Fixes golang/go#31752, fixes golang/go#33077, fixes golang/go#32814, fixes golang/go#31699, golang/go#31930
jirfag
added a commit
to golangci/tools
that referenced
this issue
Sep 9, 2019
Before separating Load* into Need* we could use LoadSyntax to get types information by loading inital packages from source code and loading it's direct dependencies from export data. It was broken when separation was introduced and before this commit everything was loading from source code what resulted into slow loading times. This commit fixes it. Also, do backwards-incompatible fix of definition of deprecated LoadImports and LoadAllSyntax. Improve an internal error message "internal error: nil Pkg importing x from y": replace it with "internal error: package x without types was imported from y". Remove packages.NeedDeps request for loading in tests TestLoadTypesBits and TestContainsOverlayXTest. Fixes golang/go#31752, fixes golang/go#33077, fixes golang/go#32814, fixes golang/go#31699, fixes golang/go#31930
Change https://golang.org/cl/186337 mentions this issue: |
jirfag
added a commit
to golangci/tools
that referenced
this issue
Sep 10, 2019
Before separating Load* into Need* we could use LoadSyntax to get types information by loading inital packages from source code and loading it's direct dependencies from export data. It was broken when separation was introduced and before this commit everything was loading from source code what resulted into slow loading times. This commit fixes it. Also, do backwards-incompatible fix of definition of deprecated LoadImports and LoadAllSyntax. Improve an internal error message "internal error: nil Pkg importing x from y": replace it with "internal error: package x without types was imported from y". Remove packages.NeedDeps request for loading in tests TestLoadTypesBits and TestContainsOverlayXTest. Fixes golang/go#31752, fixes golang/go#33077, fixes golang/go#32814, fixes golang/go#31699, fixes golang/go#31930
clintjedwards
pushed a commit
to clintjedwards/tools
that referenced
this issue
Sep 19, 2019
Before separating Load* into Need* we could use LoadSyntax to get types information by loading inital packages from source code and loading it's direct dependencies from export data. It was broken when separation was introduced and before this commit everything was loading from source code what resulted into slow loading times. This commit fixes it. Also, do backwards-incompatible fix of definition of deprecated LoadImports and LoadAllSyntax. Improve an internal error message "internal error: nil Pkg importing x from y": replace it with "internal error: package x without types was imported from y". Remove packages.NeedDeps request for loading in tests TestLoadTypesBits and TestContainsOverlayXTest. Fixes golang/go#31752, fixes golang/go#33077, fixes golang/go#32814, fixes golang/go#31699, fixes golang/go#31930 Change-Id: I416e3c1035d555d67039e45a4fdd1deb9b2184ef GitHub-Last-Rev: 2e3a46e GitHub-Pull-Request: golang#139 Reviewed-on: https://go-review.googlesource.com/c/tools/+/186337 Reviewed-by: Michael Matloob <matloob@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?My environment:
go env
OutputTravis CI environment:
go env
OutputWhat did you do?
I upgraded from golang/tools@f727befe758c to golang/tools@fe54fb3 and noticed slower performance and out-of-memory (especially when running with
CGO_ENABLED=1
forgo test -race
) errors in a non-public refactoring program that relies onpackages.Load
. I then bisected until finding golang/tools@dbeab5af.To assist my testing I used a small program to repro which just calls
packages.Load
on some public packages.In a later section I've included the output from both my local machine and a Travis build.
What did you expect to see?
I expected to see that commit golang/tools@dbeab5af did not significantly change the memory profile of programs that heavily use
packages.Load
(withTests: true
andMode: LoadSyntax
).What did you see instead?
My results (local)
golang/tools@45dd101d8784, one commit prior to bisect search result:
golang/tools@dbeab5af4b8d, result of bisect:
golang/tools@e31d36578abb, newest version at test time:
My results (on Travis CI)
Tests: true
Mode: LoadSyntax
It seems like the scope of
LoadSyntax
has significantly changed now thatLoad*
constants are now based on the more granularNeed*
, especially with regard to use ofgo/types
(based on the profiles above).If there is a combination of
Need*
options which can restore similar performance with the same returned package data, I'm very interested to use them instead ofLoadSyntax
.The text was updated successfully, but these errors were encountered: