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) Optimize fallback watcher #955

Merged
merged 3 commits into from
Apr 22, 2021

Conversation

jasonlyu123
Copy link
Member

One of the reasons for problem #950 and sublimelsp/LSP-svelte#44 encountering is devastating is that the chokidar would trigger an initial event. That causes all the js/ts files to be scanned on startup. Rather than only in npm i as I originally thought.

Even if we are excluding node_modules now. This behavior still needs to be disabled. So we can save all those IO operations on startup. And delay the language service creation when not needed.

Another change is to denounce the watch file callback. Squashing multiple changes into one. This means fewer update project files call when switching branches or when generated files are written to the file system.

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

👍 thanks for digging into this!

packages/language-server/src/lib/FallbackWatcher.ts Outdated Show resolved Hide resolved
@jasonlyu123 jasonlyu123 merged commit 3150991 into sveltejs:master Apr 22, 2021
@jasonlyu123 jasonlyu123 deleted the optimize-fallback-watcher branch April 22, 2021 07:21
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.

2 participants