x/tools/gopls: buildssa analyzer is slow on github.com/aws/aws-sdk-go-v2/service/ec2 #61506
Labels
gopls/performance
Issues related to gopls performance (CPU, memory, etc).
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
This session involves a gopls that has been modified to enable nilness.Analyzer, which itself has been modified to declare a dummy Fact that it doesn't import or export, so as to cause nilness (and thus buildssa) to be run on all dependencies. The gopls analysis driver has also been instrumented to display the wall time of each buildssa unit. Observe how expensive SSA construction is for the ec2 package, which has an extraordinary number of methods.
(This is a minimization of a performance problem reported by a user running staticcheck (whose buildir is almost identical to buildssa) on github.com/hashiform/terraform-provider-aws/internal/provider.) See #61178.
The task of this issue is to bring down the cost of buildssa so that it is proportional to the size of the package and the exportdata and factdata sizes of its direct imports, not to its transitive size. go/ssa eagerly constructs methods for every type reachable via reflection, which seems quite unnecessary.
@findleyr
The text was updated successfully, but these errors were encountered: