Optimize Cart totals calculation
Committed by srindom
fix(medusa): Optimize Cart totals calculation (#2372)
**What**
The existing totals calculations are extremely heavy and perform an enormous amount of duplicate work. The changes here remove large parts of the overhead and improves response times for cart endpoints up to 30x.Editor assessment
This is a well-crafted message with one debatable type choice. The subject 'Optimize Cart totals calculation' is imperative, specific, and comfortably under fifty characters, and the body uses a clear '**What**' section to explain the problem — duplicated heavy work in totals calculations — and quantify the win: 'improves response times for cart endpoints up to 30x.' That's exactly the context release notes need. The quibble: a performance improvement with no behavioral bug is conventionally `perf(medusa)`, not `fix`; the chosen type still lands as a patch in most tooling, but changelogs generated from types will file it under bug fixes, slightly misleading users. No breaking-change markers are needed since the public surface is unchanged. Structure is spec-clean throughout. Minor type quibble aside, this is close to exemplary.