Commit f440743
committed
perf(medusa): O(n) translations batch matching via Set lookups
The translations batch endpoint matched fetched rows against the workflow
result with translations.filter(t => result.created.some(r => r.id === t.id)),
once per row — O(n²) over the batch size, which is user-controlled. Build Sets
of created/updated ids once and test membership in O(1). Mirrors the existing
Set-based id dedup a few lines above. Behaviour is identical.1 parent e5fb75c commit f440743
2 files changed
Lines changed: 10 additions & 6 deletions
File tree
- .changeset
- packages/medusa/src/api/admin/translations/batch
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
0 commit comments