perf(data): batch MessageDao header/body updates in one transaction on the sync path #310

Closed
opened 2026-07-04 06:52:43 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-04 06:52:43 +00:00 (Migrated from github.com)

Phase-3 review (MEDIUM/efficiency). MessageDao exposes only single-row updateHeaderContent/updateBody; MailSyncer(:127) does entities.forEach{ updateHeaderContent(...) } = N separate Room transactions (journal write/fsync each) per folder per foreground sync (amplified on the encrypted cache). Fix: a single @Transaction DAO method (or runInTransaction) collapsing N commits into one. Low risk, meaningful win on a frequent path.

Phase-3 review (MEDIUM/efficiency). `MessageDao` exposes only single-row `updateHeaderContent`/`updateBody`; `MailSyncer`(:127) does `entities.forEach{ updateHeaderContent(...) }` = N separate Room transactions (journal write/fsync each) per folder per foreground sync (amplified on the encrypted cache). **Fix:** a single `@Transaction` DAO method (or `runInTransaction`) collapsing N commits into one. Low risk, meaningful win on a frequent path.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#310