-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
Make sure we're working with io.js #208
Comments
Unfortunately it appears there are some issues 😞 (note all tests pass on my machine when using node)
|
Looks like there are no logical issues, just timing. Node.js versions 0.11 and 0.8 had similar problems. Tweaking the |
|
I just realized that the whole timing issue was actually occurring because every time I tested on another version it was falling back to polling silently. |
Figured out how to make io.js take over with |
@es128 isn't chokidar still requiring fsevents although io.js is using fsevents under the hood? would it be possible to make the fsevents dependency not be a requirement for native file watching on Mac if running in io.js? |
@bpasero I don't see how io.js exposes any api which is "good enough" / generic enough for chokidar to use. |
@paulmillr right, I was hoping that their fs.watch() is good enough for chokidar. They recently added support for recursive watching on MacOS leveraging FSEvents. Did you guys ever thought about contributing your work back to io.js? I think they are much more open to contributions compared to node.js. |
@bpasero feel free to set Setting up chokidar to use the As for contributing back - not opposed to it at all of course, but chokidar continues to make more sense as a userspace module. |
@es128 my understanding is that chokidar on Windows is using fs.watch(). are you saying that even if there was native support for recursive watching (see joyent/libuv#1473), chokidar would not adopt this? My concern with the current way on Windows is that watching large directories causes high CPU/Mem load and potentially locks folders due to the recursive fs.watch() calls. |
That would be a different situation than what you first started asking on Mac, as it may make a meaningful performance impact. That's assuming whatever they do is fundamentally different and more performant than what chokidar already does. And still, it would be very tricky to juggle all the different modes targeting different platforms + node/io variants. |
@es128 yeah, sorry I am jumping a bit around. I am looking into allowing to enable the native recurse option on Windows for ReadDirectoryChangesW and while I get it to work, I am likely still suffering from all the issues around how libuv handles the event. For example, I am not getting a delete event when deleting a file, rather a "rename: null" event which is not helpful either. I understand that chokidar has code in place to detect these issues and prevent them. Would it help at all if the native recurse flag was enabled given the issues with fs.watch() in general? In other words, how does Chokidar solves these issues. Are you keeping a list of children per folder and compare the contents on such an event? |
I haven't really played with it, but afaict the native It would require a very substantial refactor to the fs.watch handler code to leverage the recursive option, it's not something we could just turn on.
yes |
@es128 I did a test comparing chokidar with fs.watch() using the recursive flag on Windows and there are major differences in terms of performance for larger folders. I understand that chokidar is doing some extra magic to get the right set of events, but imho the performance on Windows is unacceptable. I filed #228 With fs.watch() I see no CPU/mem increase whatsoever even for my large Desktop and file events bubble in instantly after startup (as opposed to chokidar - see my bug for it). |
No description provided.
The text was updated successfully, but these errors were encountered: