Skip to content

perf(imap): batch body-part fetches in getBodyStructureData#13131

Draft
hamza221 wants to merge 1 commit into
mainfrom
perf/imap-batch-body-fetch
Draft

perf(imap): batch body-part fetches in getBodyStructureData#13131
hamza221 wants to merge 1 commit into
mainfrom
perf/imap-batch-body-fetch

Conversation

@hamza221

@hamza221 hamza221 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Before

getBodyStructureData benchmark: 5 UID(s) in 2327.36 ms
getBodyStructureData benchmark: 20 UID(s) in 8091.76 ms
getBodyStructureData benchmark: 8 UID(s) in 4658.03 ms
getBodyStructureData benchmark: 20 UID(s) in 8009.11 ms
getBodyStructureData benchmark: 37 UID(s) in 13710.65 ms

After

getBodyStructureData benchmark: 5 UID(s) in 3285.25 ms
getBodyStructureData benchmark: 20 UID(s) in 1237.34 ms
getBodyStructureData benchmark: 22 UID(s) in 1126.85 ms
getBodyStructureData benchmark: 20 UID(s) in 1421.08 ms
getBodyStructureData benchmark: 37 UID(s) in 1878.88 ms

Assisted-by: Claude:claude-opus-4-8[1m]

🤖 AI (if applicable)

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

Resolve each message's body MIME IDs from the already-fetched
structures and request the union of all body parts in a single
fetch covering every UID, instead of one fetch per message. This
removes the N+1 fetch pattern: any batch now costs exactly two
fetches (structures + body parts) regardless of size.

Assisted-by: Claude:claude-opus-4-8[1m]
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 force-pushed the perf/imap-batch-body-fetch branch from 49cf117 to cc395d6 Compare June 19, 2026 14:50
@hamza221 hamza221 self-assigned this Jun 19, 2026
@hamza221 hamza221 marked this pull request as ready for review June 19, 2026 14:52
@hamza221 hamza221 marked this pull request as draft June 19, 2026 14:53
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