Open hjyssg opened 3 years ago
chokidar code reading: 下载repo npm install 跑他的example.js就好了 挺方便
lib\nodefs-handler.js _addToNodeFs _handleRead this.fsw._readdirp readdirp() _addToNodeFs (进行递归scan)
When we pass a function to process.nextTick(), we instruct the engine to invoke this function at the end of the current operation, before the next event loop tick starts:
可以加个sleep,给其他task 留cpu时间
ignore被调用两次 一次只看名字 一次带着stat 被ignore,文件就不会被get stat
_isIgnored -》 this._userIgnored -》 matchPatterns
https://stackoverflow.com/questions/17509669/how-to-install-an-npm-package-from-github-directly
chokidar会去scan所有文件的star 现在其实是双重scan了
https://nodejs.org/api/inspector.html#inspector_cpu_profiler
https://www.npmjs.com/package/fb-watchman
竞争者
chokidar code reading: 下载repo npm install 跑他的example.js就好了 挺方便
lib\nodefs-handler.js _addToNodeFs _handleRead this.fsw._readdirp readdirp() _addToNodeFs (进行递归scan)
When we pass a function to process.nextTick(), we instruct the engine to invoke this function at the end of the current operation, before the next event loop tick starts:
可以加个sleep,给其他task 留cpu时间
ignore被调用两次 一次只看名字 一次带着stat 被ignore,文件就不会被get stat
_isIgnored -》 this._userIgnored -》 matchPatterns
https://stackoverflow.com/questions/17509669/how-to-install-an-npm-package-from-github-directly