lambdaisland / lambdaisland/classpath
watch-deps watches (and hashes) all files in project
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Clojure
- Star
- 90
- Fork
- 7
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu từ DirectoryWatcher được tạo bởi watch-deps và xem xét cách beholder và directory-watcher hiện đăng ký các lượt theo dõi đệ quy và băm các tệp. So sánh hành vi đó với java.nio.file.WatchService; phần triển khai hoàn chỉnh không nên quét và băm lại các tệp dự án không liên quan, nhưng vẫn phải phát hiện các sửa đổi đối với deps.edn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- clojure, java
- Lĩnh vực
- performance, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100