Commit f17d9c2
committed
perf: allocate deck pull list in parallel instead of serially
Applying a pull list awaited one AllocateDeckCardItem mutation per physical
copy in a sequential loop, so a 60-card pull meant 60 serial round trips.
Run the entries through Promise.all instead. Each entry targets a distinct
collection item (within a deck an item maps to a single deck card), so entries
touch disjoint rows and can't race; copies of the same item within an entry
stay serial to avoid racing on that item's availability. Wall-clock drops from
the sum of all copies to the longest single entry.
Addresses #104; collapsing the bulk update/delete Promise.all loops needs new
server-side bulk mutations, tracked in #129.1 parent 4e7ffb9 commit f17d9c2
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
654 | | - | |
655 | | - | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
656 | 661 | | |
657 | 662 | | |
658 | 663 | | |
| |||
662 | 667 | | |
663 | 668 | | |
664 | 669 | | |
665 | | - | |
666 | | - | |
| 670 | + | |
| 671 | + | |
667 | 672 | | |
668 | 673 | | |
669 | 674 | | |
| |||
0 commit comments