⚡ Bolt: [성능 개선] SessionTimelineChart 데이터 매핑 방식 O(N+M)으로 최적화#282
⚡ Bolt: [성능 개선] SessionTimelineChart 데이터 매핑 방식 O(N+M)으로 최적화#282seonghobae wants to merge 1 commit into
Conversation
Refactored `SessionTimelineChart` to use a two-pointer approach for mapping tool calls into usage timeline buckets instead of nested O(N*M) `.filter()` loops. Also sorted incoming tool usage data explicitly by timestamp to ensure correctness.
|
👋 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:$O(N \times M)$ 복잡도의 중첩 $O(N+M)$ 방식으로 최적화했습니다.
SessionTimelineChart의 차트 데이터를 렌더링하기 위해usageTimeline의 각 버킷에toolCalls를 매핑하는 과정에서 사용되던.filter()루프를 제거하고 두 포인터 기반의🎯 Why: 시계열 데이터 매핑에 중첩 필터를 사용하면 도구 호출이나 이벤트 수가 많아질수록 렌더링을 차단하거나 지연시키는 병목 현상이 발생합니다. 이벤트 배열이 이미 시계열이라는 점을 활용하면 선형 시간 내에 동일한 데이터를 훨씬 빠르게 처리할 수 있습니다.
📊 Impact: 이벤트 수가 많은 세션 조회 시 렌더링 관련 오버헤드가 현저히 감소하며, 특히 배열 순회에 의한 GC 작업이 줄어들어 전반적인 프론트엔드 반응성이 개선됩니다.
🔬 Measurement:
pnpm --filter @argos/web run test src/components/dashboard/session-timeline-chart.test.tsx를 실행하여 해당 차트 컴포넌트의 기능 무결성을 확인했으며, Typecheck 와 Lint 통과도 확인했습니다.PR created automatically by Jules for task 3965610122832810651 started by @seonghobae