perf(#305): single-pass max-by-mtime for statusline todo lookup (#385)

Replace the per-render readdirSync().filter().map(statSync).sort() chain
with a single-pass max-by-mtime loop. Drops the O(n log n) sort and the
throwaway intermediate array; I/O and resolved-file behavior are identical.
Adds the first behavior-lock test for the todo-resolution path.

The larger disk-backed cache win from the issue is deferred: statusline is
a fresh child process per render, so any cache must be disk-backed with
invalidation/atomic-write design that needs maintainer input.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-27 20:21:15 -04:00
committed by GitHub
parent 51aac62e9a
commit 091b7e2c4b
3 changed files with 97 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
---
type: Fixed
pr: 305
---
Use a single-pass max-by-mtime scan for statusline todo lookup, dropping the per-render O(n log n) sort (#305).