refactor: replace chokidar with @parcel/watcher#72
Conversation
|
@pianissi What is the motivation behind changing that package? |
|
Mainly performance and startup time. When I was using the app with around 100k - 200k images it would spend around 5-15 minutes scanning for files on startup, which seemed to be chokidar crawling through directories. It also seemed to be a point of concern in previous issues in the original project (allusion-app#423) in terms of the limit of how many files would be able to be watched. I think this is less of a problem now since the feature to selectively choose which locations to sync was added, but with @parcel/watcher it should be a bit better because of the native backends and batched events. It also has the ability to query for historical changes to not need crawling through the directories on startup which is something I haven't tested. Lemme know your thoughts, since I just tried it out to see if it worked. However, there is an issue with this commit with it opening the terminal every time the watcher subscribes to events which I'm not sure about how to fix. |
|
Sounds like a great idea. I'm not one of the developers of these projects, so I can't help you more than that. |
|
This works great, it is so much faster now, thanks! |
This PR attempts to optimise the behaviour of file watching by replacing the watcher from chokidar to @parcel/watcher which uses native file watching methods.
Caveats:
Would probably be good to test more to see if it works for everyone, since I didn't do much testing other than basic functions. Seems to work well when I import and delete 10k images in one go.