Skip to content

x/tools/gopls: memory/performance regression with eager Cursor construction #76813

@findleyr

Description

@findleyr

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions