You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 2024-04-07 - Filtering Performance Optimization in Chat Component
2
+
**Learning:** Extracting inline array filtering (O(N) operations) out of the return statement into a `useMemo` hook reduces UI lag during text entry by preventing re-computation on unrelated state changes (like typing). Early returning the unmodified array when no filter is applied allows child components to bail out of re-rendering.
3
+
**Action:** Always scan for unmemoized O(N) array transformations inside JSX props, especially when the parent component has rapidly changing states like text inputs.
0 commit comments