-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
Investigating a user report from slack, I discovered that our eager construction of the Cursor on parsego.File results in around 2-3x the allocation per parsed file, when rediagnosing the workspace.
Needs more profiling: our benchmarks did not show massive regression (10% regression in DiagnoseChange/kubernetes, perhaps).
Repro:
- checkout https://github.com/cockroachdb/cockroach
- open
pkg/sql/sem/tree/expr.go, wait for gopls to finish indexing - make an arbitrary change
- grab a heap profile while gopls is reindexing
Making the Cursor lazy mitigates this regression. I think our rationale for eagerness was that the cursor would be inevitably used, but that's not the case when the parsing is only for type checking.
CC @adonovan
adonovan
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.