Skip to content
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/gopls: filecache.gc is expensive in tests #60162

Closed
adonovan opened this issue May 12, 2023 · 2 comments
Closed

x/tools/gopls: filecache.gc is expensive in tests #60162

adonovan opened this issue May 12, 2023 · 2 comments
Assignees
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

Comments

@adonovan
Copy link
Member

adonovan commented May 12, 2023

In x/tools, time go test -short -count=1 ./gopls/... takes 60s today, but only 40s if we disable the filecache.gc thread. (This is on macOS, whose filesystem often seems to be much slower than Linux.) Every gopls test process is running its own redundant filepath.Walk of the cache directory.

Given that we recently decided to give up trying to rely on the production GC behavior (and will set GOPLSCACHE=$(mktemp -d) for each builder run), it might make sense to add a 1m delay to the GC thread so that it never runs at all in the tests. But it's also possible that the change to use a fresh GOPLSCACHE per builder run reduces the amount of cache visited by each gc so much that it doesn't matter.

@adonovan adonovan self-assigned this May 12, 2023
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 12, 2023
@gopherbot gopherbot added this to the Unreleased milestone May 12, 2023
@adonovan adonovan added gopls/performance Issues related to gopls performance (CPU, memory, etc). and removed gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels May 12, 2023
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 12, 2023
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.13.0 May 12, 2023
@findleyr
Copy link
Contributor

Let's work on this next release. Unassigning for now as anyone could take this.

@adonovan adonovan self-assigned this Aug 31, 2023
@findleyr findleyr modified the milestones: gopls/v0.14.0, gopls/backlog Sep 27, 2023
@findleyr findleyr modified the milestones: gopls/v0.14.0, gopls/v0.15.0 Oct 9, 2023
@adonovan
Copy link
Member Author

adonovan commented Dec 1, 2023

I just measured this again on macOS and saw times of 1:01, 1:09 at master and 1:06, 1:02 with filecache GC disabled, testing ABAB. Closing as not significant.

@adonovan adonovan closed this as completed Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

3 participants