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

Configure chokidar to use fs.watch instead of fs.watchFile #773

Closed
wants to merge 2 commits into from

Conversation

thirtyseven
Copy link

fs.watch is preferable to fs.watchFile as it uses file change notification instead of stat polling. With large projects, there can be a significant performance improvement.

fs.watch isn't always available, so maybe this should be behind a config option? I think it's a sane default though.

@vojtajina
Copy link
Contributor

@thirtyseven I need to look into this more. While this makes sense, it's not that simple. I'm not sure about inotify (linux), but kqueue (mac) does count these listeners as open file descriptors. Common limit is 256 (which includes file writing/stating/reading) so you can easily hit that limit.

Do you have any more insights? Did you try this on linux/mac? How big project (how many files)?

This is definitely important thing.

Btw, I'm working on making watching more efficient (even with the stat polling).

@ghost ghost assigned vojtajina Oct 18, 2013
@vojtajina
Copy link
Contributor

@thirtyseven I added this as an undocumented config option (see 18514d6), so I'm closing this PR.

The problem is that fs.watch still does not work on Mac, we need to fix it first (in node). Then it can be the default option in Karma. See paulmillr/chokidar#62

Thanks for bringing this up!

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