Understand the watch-mode performance improvements
mainThe watch-mode implementation in Hunk has been updated (via PR #531) to replace the legacy 250 ms Git-backed polling loop with a more efficient system using event hints, an authoritative Git signature, and a 10-second safety check.
Key performance benefits observed in benchmarks:
- Reduced Idle CPU: Cumulative idle main-process CPU usage was reduced by 1.8–6.4×.
- Reduced Git Invocations: Git calls were reduced by 35–36×.
- Startup Latency: Mean launch-to-
File Viewlatency remains comparable to the base, with a slight increase of approximately 21 to 61 ms.
Platform-specific behaviors:
- macOS: Uses native recursive observation, reaching readiness quickly without per-directory registration.
- Linux: Uses Git-pruned Chokidar, limiting traversal to relevant roots to avoid hitting
inotifywatch limits (e.g., avoiding the ~24,000 registrations that approach the default 61,504 limit). - Windows: Intended policy is native recursion to avoid Chokidar's per-directory resource model.