perf: cache formatted date strings in EmailListScreen (P5) #51

Merged
guettlibot merged 1 commits from task/p5-date-cache into main 2026-05-14 09:31:20 +00:00
guettlibot commented 2026-05-14 09:17:20 +00:00 (Migrated from codeberg.org)

Summary

  • Add a module-level Map<int, String> that memoises DateFormat.format() keyed by local calendar day
  • In a 50-item list where many emails share the same date (e.g. all of today's mail), reduces format() calls from O(n) per rebuild to O(distinct days)
  • Zero overhead for emails with a plain-text body (cache hit after the first call per day)

Test plan

  • Existing widget tests pass unchanged
  • task check-fast green

🤖 Generated with Claude Code

## Summary - Add a module-level `Map<int, String>` that memoises `DateFormat.format()` keyed by local calendar day - In a 50-item list where many emails share the same date (e.g. all of today's mail), reduces `format()` calls from O(n) per rebuild to O(distinct days) - Zero overhead for emails with a plain-text body (cache hit after the first call per day) ## Test plan - [x] Existing widget tests pass unchanged - [x] `task check-fast` green 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.