lambdaisland / lambdaisland/classpath
watch-deps watches (and hashes) all files in project
Personne n'a encore pris cette issue.
- Langage dominant
- Clojure
- Étoiles
- 90
- Forks
- 7
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
The default behaviors of https://github.com/nextjournal/beholder and https://github.com/gmethvin/directory-watcher cause watched folders to register watches on all subfolders recursively, and 'watching' a folder reads and hashes every file within it at startup and rehashes any created/modified files on every modification. Due to this, the DirectoryWatcher created by watch-deps is reading and hashing everything under the project folder recursively (including .git, node_modules, etc) and rehashing all modified files even though the callback registered by watch-deps ultimately ignores everything but modifications to deps.edn. This can cause a long delay when watch-deps is invoked for projects with large numbers of files or just large files (e.g. data files under resources/) due the hashing on startup, and unnecessary resource usage caused by rehashing every git commit, asset file update, etc.
DirectoryWatcher can be configured not to hash or to use the file modified timestamp instead of hashing, but these options are not exposed by beholder. It doesn't appear to be possible to watch a single folder without its children using DirectoryWatcher
Would a PR that uses the native java.nio.file.WatchService directly instead of beholder/DirectoryWatcher be welcome? It appears the downside would be that WatchService uses a polling implementation on MacOS, but since it would be possible to watch the project root without any children, I would think it would still be a net win for performance.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le DirectoryWatcher créé par watch-deps et examinez comment beholder et directory-watcher enregistrent actuellement les surveillances récursives et calculent le hash des fichiers. Comparez ce comportement avec java.nio.file.WatchService ; l’implémentation terminée devrait éviter d’analyser et de recalculer le hash des fichiers du projet non concernés, tout en continuant à détecter les modifications de deps.edn.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- clojure, java
- Domaine
- performance, tooling
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100