atom-community / atom-community/autocomplete-paths

Find the best path watcher

Open
#270 0 comments 0 reactions 0 assignees View on GitHub
help wanted performance issue question released
Dominant language
JavaScript
Stars
152
Forks
57
PR merge metrics
No merged PRs in 30d

Description

### Pathwatchers

Previously we used Atom's path watcher, however, Atom's Pathwatcher is non-recursive, has issues, and lacks a maintainer to address these
https://github.com/atom/node-pathwatcher/issues/135

We switched to [chokidar](https://github.com/paulmillr/chokidar
) in the recent versions. However, I am still experimenting with chokidar. It is convenient, but not necessarily the fastest. Not sure if it is the best solution for tracking the changes in the path cache. I have noticed some slowdowns in the large projects like [this one](https://github.com/parcel-bundler/parcel/
)

I think [nsfw](https://github.com/Axosoft/nsfw) is a very good candidate. I have made [a pull request for adding prebuilds](https://github.com/Axosoft/nsfw/pull/136). When that one is merged, I will switch to nsfw.

We could also use [fb-watchman](https://www.npmjs.com/package/fb-watchman), which is a native package. I think it has a better performance compared to chokidar and atom/pathwatcher

### Should we even use a path watcher?

One optimization to perform is to maybe give up tracking the changes if the number of files is larger than some amount.

Another solution is to add event listeners to Atom's file/folder adding/removing. So, only if the user adds/remove a file/folder inside Atom itself (using TreeView for example), then we consider that as a change in our path cache.

Contributor guide

Open the contributing guide

Research direction

Locate the current chokidar integration and the path-cache code, then compare its behavior and performance with nsfw and fb-watchman, especially on large projects. The work is complete when the project has a justified path-watching choice or a documented decision to stop tracking changes under the alternatives described.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.