Skip to content

[Superseded] ⚡ Bolt: session timeline O(N+M) aggregation - #358

Closed
seonghobae wants to merge 1 commit into
developmentalfrom
bolt-optimize-session-timeline-chart-8548540820946274694
Closed

[Superseded] ⚡ Bolt: session timeline O(N+M) aggregation#358
seonghobae wants to merge 1 commit into
developmentalfrom
bolt-optimize-session-timeline-chart-8548540820946274694

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 30, 2026

Copy link
Copy Markdown

Superseded

Closed without merge because the current developmental line already contains the durable version of this performance objective. At protected-base snapshot 4f8796ec8c3a8d130136029650705714724cb0ac, SessionTimelineChart already uses a dedicated buildChartData() path that sorts local usage/tool copies and advances a single forward tool cursor, eliminating the former per-usage full toolCalls.filter() scan. The current base also has beginner-readable contracts around the helper.

This PR is based on stale developmental snapshot 9ef092b9979d46b96063701e706521d21407d6a9 and head 911dc1970ba3d9b30f539e670f72dabe1c31d980; GitHub reports it non-mergeable. Keeping it open would preserve a competing implementation path for behavior that is already present upstream. No checks, reviews, or approvals from this stale head are transferred to current development.

Incremental work that remains useful beyond the already-integrated O(N+M) algorithm must be proposed against the live developmental head as a focused diff and establish its own exact-head evidence.

* 세션 타임라인 차트의 툴 요약을 계산할 때 발생하는 중첩 루프(O(N*M)) 병목을 해결함
* usageTimeline 인덱스와 toolCalls 배열을 모두 시간순으로 정렬한 뒤, 포인터를 사용해 단일 패스(O(N+M))로 매칭하도록 리팩터링함
* 원본 배열의 순서를 유지하기 위해 `.findIndex()`를 사용하지 않고 인덱스 맵을 활용함
* 불필요한 배열 생성을 줄여 긴 세션에서의 리렌더링 속도를 크게 향상시킴
@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 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

세션 타임라인 차트가 도구 호출과 사용량 구간을 시간순으로 정렬하고 단일 포인터로 순회하도록 변경되었습니다. 도구 요약은 각 구간별로 집계되며, 차트 데이터는 원래 타임라인 순서로 생성됩니다.

Changes

세션 타임라인 도구 요약 최적화

Layer / File(s) Summary
정렬 기반 도구 요약 및 차트 데이터 생성
packages/web/src/components/dashboard/session-timeline-chart.tsx
getToolSummaryForIndex를 제거하고, 시간순으로 정렬한 toolCallsusageTimeline을 단일 포인터로 순회해 도구별 개수를 집계하고 원래 인덱스 순서의 chartData를 생성합니다.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Possibly related PRs

  • ContextualWisdomLab/argos#333: 동일한 차트 컴포넌트에서 중첩 필터를 정렬 기반 투 포인터 순회로 변경한 내용과 직접 연결됩니다.
  • ContextualWisdomLab/argos#337: 도구 요약 집계를 O(N*M) 방식에서 O(N+M) 방식으로 변경한 동일한 최적화를 다룹니다.
  • ContextualWisdomLab/argos#346: 도구 요약 헬퍼 제거와 타임라인 차트 데이터 생성 방식 변경이 동일합니다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 세션 타임라인 차트의 렌더링 성능을 O(N+M)으로 최적화한 변경을 정확히 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt-optimize-session-timeline-chart-8548540820946274694

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/web/src/components/dashboard/session-timeline-chart.tsx (1)

103-170: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

정렬·구간 경계·요약 결과를 검증하는 회귀 테스트를 추가하세요.

현재 테스트는 단일 시간순 입력의 렌더링만 확인하므로, 원래 순서 복원, prev < tool <= current 경계, 반복 도구 집계 및 상위 3개 축약이 깨져도 통과합니다. 비정렬 타임라인과 경계 시각의 도구 호출을 포함해 차트 데이터/툴팁 요약을 검증하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/web/src/components/dashboard/session-timeline-chart.tsx` around
lines 103 - 170, 차트 데이터 생성 로직에 대한 회귀 테스트를 추가하세요. 비정렬 usageTimeline 입력이 원래 순서로
복원되는지, 도구 호출이 prevTimestamp보다 크고 currentTimestamp 이하인 경우에만 해당 구간에 포함되는지, 동일 도구의
반복 호출이 집계되는지 검증하세요. 또한 도구 종류가 3개를 초과할 때 상위 3개와 “+N more” 요약이 차트 데이터 또는 툴팁에 정확히
표시되는지 확인하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/web/src/components/dashboard/session-timeline-chart.tsx`:
- Around line 103-170: 차트 데이터 생성 로직에 대한 회귀 테스트를 추가하세요. 비정렬 usageTimeline 입력이 원래
순서로 복원되는지, 도구 호출이 prevTimestamp보다 크고 currentTimestamp 이하인 경우에만 해당 구간에 포함되는지, 동일
도구의 반복 호출이 집계되는지 검증하세요. 또한 도구 종류가 3개를 초과할 때 상위 3개와 “+N more” 요약이 차트 데이터 또는 툴팁에
정확히 표시되는지 확인하세요.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: de38b3fa-0bdd-4539-ab7f-9a854469e3aa

📥 Commits

Reviewing files that changed from the base of the PR and between 9ef092b and 911dc19.

📒 Files selected for processing (1)
  • packages/web/src/components/dashboard/session-timeline-chart.tsx

Copy link
Copy Markdown
Author

Closing as superseded by merged PR #271. #271 already replaced the same SessionTimelineChart repeated tool-event filtering with a sorted local snapshot plus single forward cursor, while preserving original input order and adding stronger cumulative-summary, ordering, bounded-display, and mutation regressions with APA 7 doctoring. This one-file stale-base branch has no distinct remaining capability, so it must not remain a competing merge path. Historical evidence is not reused.

@google-labs-jules

Copy link
Copy Markdown

Closing as superseded by merged PR #271. #271 already replaced the same SessionTimelineChart repeated tool-event filtering with a sorted local snapshot plus single forward cursor, while preserving original input order and adding stronger cumulative-summary, ordering, bounded-display, and mutation regressions with APA 7 doctoring. This one-file stale-base branch has no distinct remaining capability, so it must not remain a competing merge path. Historical evidence is not reused.

Understood. Acknowledging that this work is now obsolete as it has been superseded by merged PR #271, and stopping work on this task.

@seonghobae seonghobae changed the title ⚡ Bolt: [performance improvement] session-timeline-chart의 렌더링 성능 최적화 (O(N+M)) [Superseded] ⚡ Bolt: session timeline O(N+M) aggregation Aug 7, 2026
@seonghobae seonghobae closed this Aug 7, 2026
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