hjyssg / ShiguReader

硬核宅宅资源管理器. Ultimate Manga Resource Manager
MIT License
396 stars 45 forks source link

chokidar code reading #143

Open hjyssg opened 3 years ago

hjyssg commented 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

hjyssg commented 3 years ago

chokidar会去scan所有文件的star 现在其实是双重scan了

hjyssg commented 3 years ago

https://nodejs.org/api/inspector.html#inspector_cpu_profiler

hjyssg commented 3 years ago

https://www.npmjs.com/package/fb-watchman

竞争者