Agenda refresh still filters and stats the file list on the main actor #227

open cmc opened this on 2026-11-22 12:37 UTC · feature · milestone Backlog

Discussion

cmc 2026-11-22 12:37 UTC

Found while fixing #196. After that change a cache-hit refresh of 10,000 agenda files still stalls the main actor for 29–44 ms.

AgendaModel.files filters and sorts the whole file list on the main actor three times per refresh, twice only for Perf labels. With org-agenda-files set, AgendaFiles.resolve also calls fileExists for every file each time.

The agenda cache is also not invalidated from file events: changedFile carries only the last path and rescans carry none, so every refresh stats every file.

Platforms: Mac, iOS.