Skip to content

⚡ Bolt: 세션 타임라인 차트의 날짜 파싱 중복 제거 최적화 - #343

Open
seonghobae wants to merge 4 commits into
developmentalfrom
bolt/optimize-date-parsing-10493176468770379226
Open

⚡ Bolt: 세션 타임라인 차트의 날짜 파싱 중복 제거 최적화#343
seonghobae wants to merge 4 commits into
developmentalfrom
bolt/optimize-date-parsing-10493176468770379226

Conversation

@seonghobae

Copy link
Copy Markdown

💡 What: SessionTimelineChart 컴포넌트 렌더링 시 리스트의 크기만큼 반복적으로 실행되던 날짜 문자열 파싱(new Date(u.timestamp).getTime())을 useMemo를 이용해 별도로 분리하고 숫자 배열로 사전 연산하여 캐싱했습니다.

🎯 Why: 리액트 컴포넌트가 다시 렌더링될 때마다 chartData 내부 루프에서 동일한 날짜 문자열을 매번 반복적으로 파싱하고 있었습니다. 이는 배열 크기에 비례하는(O(N)) 불필요한 연산 비용을 발생시켜, 세션 타임라인이 길어질수록 UI 렌더링 병목이 될 수 있습니다.

📊 Impact:

  • 차트 렌더링 시 발생하는 문자열 기반의 날짜 생성/파싱 횟수를 렌더링마다 O(2N)에서 의존성 변경 시 O(N)으로 대폭 감소.
  • useMemo를 통해 usageTimeline이 변경되지 않는 한 파싱 오버헤드가 완전히 0이 되어, 빠른 컴포넌트 리렌더링 및 부드러운 스크롤 경험을 제공.

🔬 Measurement:

  • 차트 렌더링을 포함한 페이지 프로파일링 시 Date 객체 생성 및 문자열 파싱에 소요되는 메인 스레드 실행 시간 측정.
  • 데이터가 많은 대규모 세션 페이지(예: 수백 개의 턴)에서 컴포넌트 리렌더링 소요 시간 확인.

PR created automatically by Jules for task 10493176468770379226 started by @seonghobae

SessionTimelineChart 내의 getToolSummaryForIndex 호출 시마다 발생하던
O(n) 크기의 new Date().getTime() 문자열 파싱 오버헤드를 해결했습니다.

- useMemo를 활용하여 usageTimeline의 모든 날짜 문자열을 차트 렌더링 전에
  미리 숫자형(timestamp) 배열로 파싱 및 캐싱
- 매번 렌더링 될 때마다 발생하는 불필요한 날짜 객체 생성 및 문자열 파싱 비용 제거
- 파싱된 숫자 배열을 이용해 O(1) 조회로 차트 데이터 생성

이는 세션 히스토리가 길어질수록 렌더링 속도 저하를 방지합니다.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6970046d-f514-459d-9680-ab0fb1db9741

📥 Commits

Reviewing files that changed from the base of the PR and between 9ef092b and 6b3b3ae.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • packages/web/src/components/dashboard/session-timeline-chart.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt/optimize-date-parsing-10493176468770379226

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant