⚡ Bolt: [성능 개선] 중복되는 buildTimelineGroups 연산을 상위 컴포넌트로 올려 캐싱#100
Conversation
…licate calculation `buildTimelineGroups` was calculated redundantly inside both `EventList` and `SessionActivityRibbon` inside `useMemo` hooks. This commit moves the `useMemo` computation into the parent `page.tsx` component and passes down `groups` as a prop to its children, preventing duplicate O(n) array iterations per `events` change.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What:
page.tsx(the parent component) now pre-computesgroupsusinguseMemo(() => buildTimelineGroups(events), [events])and passes the result as a prop to its child components (EventListandSessionActivityRibbon).🎯 Why:
Both
EventListandSessionActivityRibbonwere callingbuildTimelineGroups(events)inside their ownuseMemohooks. Sinceeventscan contain many elements, iterating over the array redundantly in two different child components results in unnecessary CPU cycles wheneventschanges.📊 Impact:
Reduces redundant O(n) array reduction passes from 2 down to 1 when computing timeline groups from raw events.
🔬 Measurement:
No broken tests; visual regression avoids extra rendering passes. Code runs correctly.
PR created automatically by Jules for task 10280015208843955185 started by @seonghobae