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

perf(lsp): fix redundant file reads #20802

Merged
merged 3 commits into from Oct 12, 2023

Conversation

nayeemrmn
Copy link
Collaborator

When populating FileSystemDocs, we read files into it here: https://github.com/denoland/deno/blob/v1.37.1/cli/lsp/documents.rs#L762. But this was being invoked redundantly all over the place because we were unnecessarily invalidating the existing entry. In particular Document::open() was setting the fs_version to "1" invariably. Now it's set according to the file's mtime and updated whenever a save notification is received.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! This should be a nice improvement.

cli/lsp/documents.rs Outdated Show resolved Hide resolved
@nayeemrmn nayeemrmn merged commit eaeb10c into denoland:main Oct 12, 2023
13 checks passed
@nayeemrmn nayeemrmn deleted the lsp-redundant-reads branch October 12, 2023 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants