Skip to content

x/tools/internal/gopathwalk: regression in module cache scan performance #65531

Closed
@findleyr

Description

@findleyr

As described in the discussion of https://go.dev/cl/508506, simplifying gopathwalk to use filepath.WalkDir had the unfortunate consequence of significantly slowing performance when starting from a cold module cache, as would be the case when running goimports from the command line. This is also very noticeable when gopls is initially started. On my laptop, with a 19GB module cache, warming up goimports went from ~6s to ~30s.

Because this latency was already a concern for gopls (see #44863), I don't think we can afford such a significant regression. With that said, the regression is probably possible to mitigate with alternative concurrency strategies. A benchmark is added in https://go.dev/cl/561436 which we can use for revisiting the simplification. For now, I think we need to temporarily revert CL 508506.

CC @bcmills

Metadata

Metadata

Assignees

Labels

FixPendingIssues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.ToolSpeedToolsThis label describes issues relating to any tools in the x/tools repository.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions