Skip to content

[WIP] perf: make mailbox prefetch selection more selective#13206

Draft
joshtrichards wants to merge 2 commits into
mainfrom
jtr/pref-mailbox-prefetch-selectiveness
Draft

[WIP] perf: make mailbox prefetch selection more selective#13206
joshtrichards wants to merge 2 commits into
mainfrom
jtr/pref-mailbox-prefetch-selectiveness

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Jul 3, 2026

Copy link
Copy Markdown
Member

Identified this while using AI to poke around for relatively low-risk, high return performance opportunities.

This adjusts mailbox prefetching to be more selective.

I'm not convinced yet this is the right approach or beneficial enough. Experimenting...

Today we prefetch the first page for every subscribed mailbox in the current account. That improves perceived folder switching, but it also creates speculative work for folders the user may never open in the session. This changeset keeps the existing prefetch mechanism, including the HTTP cache behavior added in #11293, but narrows the candidate set toward more prominent/likely-next folders.

The main goal is to reduce startup/background work while preserving most of the “open folder instantly” benefit from #10986.

This is intentionally experimental. The selection heuristic and cap are meant as a first pass, not a final tuning. If the trade-off looks wrong in practice, we can adjust the candidate ranking, the cap, or revert to broader prefetching.

Notes:

  • keeps prefetching enabled
  • keeps cache-buster based HTTP caching intact
  • changes only which folders are chosen for speculative prefetch

What to validate:

  • perceived responsiveness when opening Mail
  • whether common next folder opens still feel instant
  • whether users with many subscribed folders see less unnecessary startup work

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant