Category: performance
Problem
In src/app/dashboard/analytics/page.tsx, pieData, totalVolume, and totalCount are recomputed via .map()/.reduce() directly in the component body on every render, feeding two separate ResponsiveContainer/chart instances, with no useMemo.
Impact
Recharts re-renders are relatively expensive (SVG re-layout); recomputing and re-rendering both charts on any unrelated parent re-render is wasted work.
Suggested fix
Wrap pieData/totalVolume/totalCount derivation in useMemo(() => ..., [stats]).
Category: performance
Problem
In
src/app/dashboard/analytics/page.tsx,pieData,totalVolume, andtotalCountare recomputed via.map()/.reduce()directly in the component body on every render, feeding two separateResponsiveContainer/chart instances, with nouseMemo.Impact
Recharts re-renders are relatively expensive (SVG re-layout); recomputing and re-rendering both charts on any unrelated parent re-render is wasted work.
Suggested fix
Wrap
pieData/totalVolume/totalCountderivation inuseMemo(() => ..., [stats]).