perf: parallelize get_card_embeds calls in display_cards #98
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
ai-working
bug
enhancement
feature
in-queue
performance
security
tech-debt
todo
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-discord#98
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
display_cards()inhelpers/main.py(~line 349) builds card embeds with:This looks parallel but isn't —
awaitin a list comprehension runs sequentially. Eachget_card_embeds()call makes 2 DB round-trips (evolution state + paperdex lookup). For 5 packs × 5 cards = 50 sequential DB calls.Proposed Fix
Replace with
asyncio.gather():Impact
Second biggest bottleneck. Cuts 50 sequential round-trips down to ~2 (the two independent DB calls per card, run in parallel across all cards).