Skip to content

⚡ Bolt: React Flow 렌더링 성능 최적화 (WeakMap 캐시 도입)#574

Open
seonghobae wants to merge 4 commits into
mainfrom
bolt-optimize-react-flow-search-7465768872023339896
Open

⚡ Bolt: React Flow 렌더링 성능 최적화 (WeakMap 캐시 도입)#574
seonghobae wants to merge 4 commits into
mainfrom
bolt-optimize-react-flow-search-7465768872023339896

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What: React Flow에서 노드 드래그 시 발생하는 과도한 리렌더링 및 검색 함수 재연산을 방지하기 위해 WeakMap 기반 캐싱을 구현했습니다.
🎯 Why: ERD 검색 필터가 활성화된 상태에서 노드를 드래그할 때 nodes 상태가 60fps로 업데이트되면서 visibleNodes가 모든 노드에 대해 새로운 data 객체를 생성합니다. 이로 인해 TableNodeReact.memo (prev.data === next.data) 얕은 비교가 깨져 전체 그래프가 깊은 리렌더링(O(N))되며 렌더링 성능이 심각하게 저하되는 문제를 해결합니다.
📊 Impact:

  • 활성 상태의 검색 필터가 적용된 노드 드래그 시 발생하는 프레임 드랍 제거
  • React 컴포넌트 깊은 렌더링 발생 횟수를 드래그 이벤트당 O(N)에서 O(0)으로 감소 (메모이제이션 동작 복구)
  • 매 프레임별 메모리 할당 및 가비지 컬렉션(GC) 압력 해소
    🔬 Measurement: 검색창에 검색어를 입력한 후 여러 개의 테이블이 있는 ERD에서 특정 노드를 드래그하여 브라우저 프로파일러 상의 렌더링 비용(ms/frame) 개선을 확인할 수 있습니다.

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

- `App.tsx`의 `visibleNodes`에서 노드 드래그(60fps) 시 불필요한 `node.data` 객체 할당을 방지하고 `React.memo` 참조를 유지하도록 `WeakMap` 캐시 적용.
- `search.ts`의 `findSearchMatchedNodeIds` 검색 로직에도 `node.data` 기반의 `WeakMap` 캐시를 도입하여 드래그 중 O(N*C) 탐색 재실행 방지.
- `cardinalityColumns` 의존성 배열을 객체 참조(cardinalityNode)에서 데이터 참조(cardinalityNode?.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.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head d938f8fe3930e5cd405ba4546a9acef0528e13af.

  • Head SHA: d938f8fe3930e5cd405ba4546a9acef0528e13af

  • Workflow run: 29452737719

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: bolt.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: bolt.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Frontend (2 files)"]
  S2 --> I2["browser runtime and bundle"]
  I2 --> R2["Review risk: Frontend (2 files)"]
  R2 --> V2["frontend tests"]
Loading

@opencode-agent

opencode-agent Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 320645b1bd403f0801e164e14686df7a787c30fb
  • Workflow run: 29456615449
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 320645b1bd403f0801e164e14686df7a787c30fb.

  • Head SHA: 320645b1bd403f0801e164e14686df7a787c30fb

  • Workflow run: 29456615449

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: bolt.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: bolt.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Frontend (2 files)"]
  S2 --> I2["browser runtime and bundle"]
  I2 --> R2["Review risk: Frontend (2 files)"]
  R2 --> V2["frontend tests"]
Loading

- App.tsx의 visibleNodes에서 노드 드래그(60fps) 시 불필요한 node.data 객체 할당을 방지하고 React.memo 참조를 유지하도록 WeakMap 캐시 적용.
- search.ts의 findSearchMatchedNodeIds 검색 로직에도 node.data 기반의 WeakMap 캐시를 도입하여 드래그 중 O(N*C) 탐색 재실행 방지.
- cardinalityColumns 의존성 배열을 객체 참조(cardinalityNode)에서 데이터 참조(cardinalityNode?.data)로 변경하여 렌더링 최적화.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 402f2b0713458d4f334e49a616f1b61c5c36702c.

  • Head SHA: 402f2b0713458d4f334e49a616f1b61c5c36702c

  • Workflow run: 29453741368

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: bolt.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: bolt.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Frontend (2 files)"]
  S2 --> I2["browser runtime and bundle"]
  I2 --> R2["Review risk: Frontend (2 files)"]
  R2 --> V2["frontend tests"]
Loading

- App.tsx의 visibleNodes에서 노드 드래그(60fps) 시 불필요한 node.data 객체 할당을 방지하고 React.memo 참조를 유지하도록 WeakMap 캐시 적용.
- search.ts의 findSearchMatchedNodeIds 검색 로직에도 node.data 기반의 WeakMap 캐시를 도입하여 드래그 중 O(N*C) 탐색 재실행 방지.
- cardinalityColumns 의존성 배열을 객체 참조(cardinalityNode)에서 데이터 참조(cardinalityNode?.data)로 변경하여 렌더링 최적화.
- CI 빌드 오류 해결을 위해 packageManager 명시 (pnpm@10.30.3)
- App.tsx의 visibleNodes에서 노드 드래그(60fps) 시 불필요한 node.data 객체 할당을 방지하고 React.memo 참조를 유지하도록 WeakMap 캐시 적용.
- search.ts의 findSearchMatchedNodeIds 검색 로직에도 node.data 기반의 WeakMap 캐시를 도입하여 드래그 중 O(N*C) 탐색 재실행 방지.
- cardinalityColumns 의존성 배열을 객체 참조(cardinalityNode)에서 데이터 참조(cardinalityNode?.data)로 변경하여 렌더링 최적화.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 320645b1bd403f0801e164e14686df7a787c30fb.

  • Head SHA: 320645b1bd403f0801e164e14686df7a787c30fb

  • Workflow run: 29456615449

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: bolt.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: bolt.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Frontend (2 files)"]
  S2 --> I2["browser runtime and bundle"]
  I2 --> R2["Review risk: Frontend (2 files)"]
  R2 --> V2["frontend tests"]
Loading

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