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

PR: Improve performance of workspace watcher (Projects) #21762

Merged

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Feb 2, 2024

Description of Changes

  • Switch from Watchdog's OS-based observer to the polling one because it emits less events on Linux and behaves better on Windows (there doesn't seem to be problems on Mac, but we prefer to have a single solution for all OSes).
  • Exclude binary files and hidden directories from the watcher.
  • Exclude directories such as __pycache__ and build from the watcher too.
  • Throttle changes reported by the watcher to avoid sending too many events to LSP servers.

Issue(s) Resolved

Part of #10664.

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:

- That way we avoid flooding the LSP server with too many requests.
- Also, fix test that checks the watcher functionality and remove
usage of to_text_string in it.
That's because it's more performant on Linux and behaves better on
Windows. It seems there are no issues with the current observer on Mac,
but I think it's better to have a single solution for all OSes.
@pep8speaks
Copy link

pep8speaks commented Feb 2, 2024

Hello @ccordoba12! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-02-02 22:18:23 UTC

- We also ignore some especial folders like __pycache__ and build.
- Expand test_filesystem_notifications to cover those cases.
@ccordoba12 ccordoba12 merged commit 12e7033 into spyder-ide:master Feb 3, 2024
14 checks passed
@ccordoba12 ccordoba12 deleted the workspace-watcher-performance branch February 3, 2024 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants