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

Feature request: OSX optimizations #342

Open
e2 opened this issue Aug 20, 2015 · 0 comments
Open

Feature request: OSX optimizations #342

e2 opened this issue Aug 20, 2015 · 0 comments
Labels
darwin ✨ Feature Adds a new feature

Comments

@e2
Copy link
Contributor

e2 commented Aug 20, 2015

Basically, Listen is a huge workaround for a lack of decent file monitoring on OSX.

Poorly performing scenario: watching a large project with a frequently changing log file in the project root may cause the whole project to be scanned unnecessarily every time there's a change. And symlinks can increase the overhead exponentially (currently warnings are shown).

Reasons for poor performance:

  1. Listening on OSX is recursion-only
  2. OSX reports only directories (because AFAIK reporting file changes generates too many events - see rb-fsevent Readme), so Listen has to keep an in-memory filesystem snapshot and compare directories recursively during changes
  3. Listen doesn't keep full directory metadata (yet), so OSX snapshot comparing is done recursively and too often
  4. The HFS filesystem uses 1-second accuracy, so Listen uses MD5 hashing to accurately detect whether a change occured or not
  5. Case insensitivity causes certain issue on OSX (see rb-fsevent Readme)

Why this hasn't been fixed yet:

  1. I (@e2, the current maintainer) don't have OSX (I only use Linux), so I have no sane way of safely improving and testing changes on OSX
  2. Listen is quite complex, and some groundwork was necessary to allow for changes (done in Listen 3.0)

What to do to improve things:

  1. Research if file-changes mode in rb-fsevent is still really as bad nowadays
  2. Implement full directory metadata (basically just extra fstat() fields in Listen::Record)
  3. Implement an "invalidations" layer (translating low-level adapter events into "what needs to be refreshed" in Listen::Record)
  4. Then, implementing OSX specific optimizations should be much, much easier

References, details, related issues:

@e2 e2 added the ✨ Feature Adds a new feature label Aug 20, 2015
@e2 e2 added the darwin label Apr 22, 2016
@ghost ghost deleted a comment Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
darwin ✨ Feature Adds a new feature
Projects
None yet
Development

No branches or pull requests

1 participant