Skip to content

⚡ Bolt: [성능 향상] React Flow 검색 데이터 캐싱으로 불필요한 노드 렌더링 방지 - #657

Closed
seonghobae wants to merge 1 commit into
mainfrom
bolt-performance-improvement-589112075250166055
Closed

⚡ Bolt: [성능 향상] React Flow 검색 데이터 캐싱으로 불필요한 노드 렌더링 방지#657
seonghobae wants to merge 1 commit into
mainfrom
bolt-performance-improvement-589112075250166055

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What:

React Flow에서 검색 시 강조 표시에 따라 노드 데이터를 변경할 때, 변경되지 않은 상태의 노드들에 대해서도 매번 새로운 data 객체가 할당되어 전체 그래프가 불필요하게 렌더링되는 문제를 해결했습니다. 모듈 범위의 WeakMap(searchDataCache)을 사용하여 원본 node.data 참조를 기반으로 장식된(decorated) 데이터를 캐시했습니다.

🎯 Why:

검색 텍스트가 바뀔 때마다 모든 노드의 데이터를 매핑하고 새로운 객체를 반환하게 되면, isHighlightedisDimmed 상태가 변하지 않은 수많은 노드들의 경우에도 식별자(reference identity)가 달라져 React Flow의 모든 Custom Node (React.memo 적용 컴포넌트)들이 리렌더링됩니다. 큰 그래프에서는 심각한 프레임 드랍(60fps 이하)을 발생시킵니다.

📊 Impact:

  • 일치/비일치 상태가 변하지 않은 노드의 리렌더링을 100% 방지합니다.
  • 검색 이벤트 핸들러 수행 시 O(N) 객체 메모리 할당 및 GC 부담을 없앱니다.
  • React.memo가 정상적으로 동작하여 프레임 드롭이 크게 줄어듭니다.

🔬 Measurement:

큰 데이터베이스 모델 (노드 수백 개 이상)에서 좌측 패널 상단의 검색(Search) 창에 테이블 이름을 빠르게 입력할 때, 성능 탭에서 "React Flow Render" 시간이 얼마나 감소했는지 확인합니다. 최적화 후에는 실제로 상태가 바뀐 극소수의 노드만 렌더링됩니다.


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

- React Flow 데이터 객체 변이로 인한 전체 렌더링 성능 문제 해결.
- `WeakMap`을 사용하여 불필요한 `node.data` 할당 방지 및 객체 참조 식별 유지.
@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.

Copilot AI review requested due to automatic review settings July 26, 2026 21:43
@coderabbitai

coderabbitai Bot commented Jul 26, 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: 1 minute

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: 5fef1008-ef29-48c4-8c36-89dfdc9f7706

📥 Commits

Reviewing files that changed from the base of the PR and between 4bf3968 and 38eebbd.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • frontend/src/App.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt-performance-improvement-589112075250166055

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

Copilot AI 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.

Pull request overview

React Flow에서 검색 강조 상태(isHighlighted/isDimmed) 반영 시 node.data의 reference identity가 불필요하게 바뀌어 대규모 그래프에서 리렌더링/GC 부담이 커지는 문제를, WeakMap 기반 캐싱으로 완화하는 성능 최적화 PR입니다.

Changes:

  • 검색 상태가 바뀌지 않은 노드에 대해 동일한 data 객체 참조를 재사용하도록 WeakMap(searchDataCache) 캐싱 로직 추가
  • 검색 입력 시 nodes.map에서 생성되는 불필요한 data 객체 할당을 줄여 React Flow 커스텀 노드의 React.memo 효율을 유지
  • Bolt 학습 문서에 React Flow 데이터 참조/렌더링 성능 관련 인사이트 추가

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
frontend/src/App.tsx 검색 하이라이트 적용 시 node.data 파생 객체를 WeakMap으로 캐싱해 참조 안정성 유지
.jules/bolt.md React Flow 노드 데이터 변이/참조 변경이 렌더링 성능에 미치는 영향과 대응(WeakMap 캐시) 기록

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/App.tsx
Comment on lines +123 to +124
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const searchDataCache = new WeakMap<object, any>();
@seonghobae

Copy link
Copy Markdown
Collaborator Author

Closed as superseded/duplicate agent perf micro-optimization; main already has comparable Bolt export/render opts (#561/#538). Commercial-baseline drain: not uniquely required.

@seonghobae seonghobae closed this Jul 31, 2026
@google-labs-jules

Copy link
Copy Markdown

Closed as superseded/duplicate agent perf micro-optimization; main already has comparable Bolt export/render opts (#561/#538). Commercial-baseline drain: not uniquely required.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

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.

2 participants