yuanchuan / node-watch

A wrapper and enhancements for fs.watch
https://npm.im/node-watch
MIT License
339 stars 44 forks source link

Avoid synchronous fs calls #107

Open maksis opened 3 years ago

maksis commented 3 years ago

If the disk is under unusually heavy load (or the response times are long for other reason), I'd assume that the current synchronous fs calls in is.js can cause the process event loop to be blocked for an unnecessarily long time when receiving a burst of change notifications or performing the initial directory tree scan (looks like is.directory is even called twice for each directory).

I suspect that this is currently causing timeouts in my project as the Node process isn't able to process user/socket ping requests for a few users that have their disks under heavy load (e.g. https://github.com/airdcpp-web/airdcpp-share-monitor/issues/2).

yuanchuan commented 3 years ago

Looks like the modifications will be huge. Are you sure this is the bottle neck to airdcpp-share-monitor ?