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

Prefer file events over directory events in OSX watch service? #22

Open
jvican opened this issue Aug 30, 2018 · 2 comments
Open

Prefer file events over directory events in OSX watch service? #22

jvican opened this issue Aug 30, 2018 · 2 comments

Comments

@jvican
Copy link

jvican commented Aug 30, 2018

I was having a look at the Carbon file event API and the current implementation of the OSX's watch service. I realized that the events that Carbon notifies us about are at the directory level, and hence in our callback implementation we're iterating on all the files present in that directory at once and finding the ones that were created/modified/deleted.

The main issue with this implementation is performance. It seems we could improve it by enabling events at the file level with the following flag https://developer.apple.com/documentation/coreservices/1455376-fseventstreamcreateflags/kfseventstreamcreateflagfileevents?language=objc. This way, we don't need to list all the recursive files in every event that we receive every time we get a directory event every 500 ms (the default latency).

@gmethvin
Copy link
Owner

I think it's worth a try. If we do try it, we should make sure we test performance with making large changes to directory structures, as that could lead to a lot of events being generated.

@jvican
Copy link
Author

jvican commented Aug 30, 2018

Yes, that's something we must test. I'm not in a rush to implement this, so if somebody else wants to give a try before me, go ahead. Realistically speaking, I don't have time for this in the next 4 months.

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

No branches or pull requests

2 participants