Skip to content

⚡ Bolt: [성능 개선] 초기 로딩 시 불필요한 DOM 쿼리 지연#36

Open
seonghobae wants to merge 3 commits into
mainfrom
bolt/optimize-dom-query-9017068382153449244
Open

⚡ Bolt: [성능 개선] 초기 로딩 시 불필요한 DOM 쿼리 지연#36
seonghobae wants to merge 3 commits into
mainfrom
bolt/optimize-dom-query-9017068382153449244

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

💡 What:

  • setLanguage 함수에서 document.documentElement.lang과 요청 언어가 일치하는 초기 로드 시 querySelectorAll("[data-i18n]") 실행을 건너뛰도록 최적화했습니다.
  • 성능 개선을 위한 조건부 DOM 쿼리 처리(isInitialDefaultLoad)를 도입하여 초기 렌더링 성능을 높였습니다.

🎯 Why:

  • 현재 단순 정적 i18n 구현 방식에서는 이미 초기 HTML이 한국어로 작성되어 있음에도 불구하고 페이지 로드 시 140개 이상의 노드들을 순회하며 node.textContent를 일일이 확인하고 있었습니다.
  • 이는 메인 스레드 시간과 리소스를 낭비하는 작업이었으므로, 이를 최소화하여 성능 병목을 예방하기 위함입니다.

📊 Impact:

  • 서버가 렌더링한 기본 언어 초기 설정 시, 불필요한 노드 트리 탐색 및 반복문 처리를 완전히 제거함으로써 메인 스레드 렌더링 비용을 감소시켰습니다.
  • 코드의 변경점은 조건문과 플래그 추가로만 구성되어 구조적 복잡도를 거의 높이지 않으면서 측정 가능한 성능 이득을 챙겼습니다.

🔬 Measurement:

  • 브라우저 개발자 도구의 Performance 탭을 통해 초기 DOMContentLoaded 단계에서의 스크립트 실행 시간이 단축되는 것을 측정할 수 있습니다.
  • 테스트 용도로 포함시킨 test_i18n.html를 통해 언어 변경(en -> ko) 시 기능이 여전히 완벽히 작동하는 것을 검증했습니다.

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

@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

Choose a reason for hiding this comment

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

Pull request overview

OpenCode model attempts did not emit a usable current-head control block, so the approval gate used deterministic current-head evidence instead of model prose.

Findings

No blocking findings.

Summary

  • Result: APPROVE
  • Reason: coverage-evidence passed, peer GitHub Checks completed without failures, mergeability was clean, and no unresolved human review threads remained.
  • Deterministic evidence: current-head changed-file evidence (.jules/bolt.md, CHANGELOG.md, i18n.js, test_i18n.html); coverage-evidence result success; peer checks from statusCheckRollup excluding this OpenCode check.
  • Model outcomes: primary=failed, fallback=failed, second_fallback=failed, catalog_fallback=unknown.
  • Head SHA: 585a8e554494f869ce102488241fb19c79359e55
  • Workflow run: 28386789857
  • Workflow attempt: 1

Deterministic fallback approval was used only after model-output instability and did not bypass coverage, failed-check, mergeability, or human-review gates.

Change Flow DAG

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test_i18n.html"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_i18n.html"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Jun 29, 2026

Copy link
Copy Markdown

OpenCode Review Overview

  • Head SHA: 585a8e554494f869ce102488241fb19c79359e55
  • Workflow run: 28459522908
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode exhausted the configured model pool without a usable current-head review conclusion. This is not approval evidence, so the PR is blocked until a source-backed review can establish approval sufficiency or identify concrete fixes.

Findings

1. HIGH .jules/bolt.md:1 - OpenCode could not establish approval sufficiency

  • Problem: every configured model path failed to produce a usable current-head control block.
  • Root cause: model execution, timeout, export, normalization, or approval-gate validation did not complete after exponential retry across the configured model pool.
  • Impact: approving from deterministic check state alone would miss PR-intent mismatches, missing files, edge-case bugs, robustness gaps, UX/DX regressions, security issues, and CodeGraph-backed base/head flow changes.
  • Fix: rerun OpenCode after model availability recovers, or update the PR with the missing files, tests, docs, generated artifacts, and verification evidence needed for a source-backed review conclusion.
  • Regression test: keep the approval gate posting REQUEST_CHANGES, not APPROVE or check-only failure, when no model produces a valid current-head review.

Summary

  • Result: REQUEST_CHANGES
  • Reason: coverage-evidence passed and peer GitHub Checks completed without failures, but no model produced a valid review control block.
  • Deterministic evidence checked but not used for approval: current-head changed-file evidence (.jules/bolt.md, CHANGELOG.md, i18n.js, test_i18n.html); coverage-evidence result success; peer checks from statusCheckRollup excluding this OpenCode check.
  • Model outcome: model_pool=exhausted; selected_model=none.
  • Head SHA: 585a8e554494f869ce102488241fb19c79359e55
  • Workflow run: 28459522908
  • Workflow attempt: 1

No PR approval was posted because model-output failure is not evidence that the PR has no blockers.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test_i18n.html"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_i18n.html"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent opencode-agent 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.

Pull request overview

OpenCode exhausted the configured model pool without a usable current-head review conclusion. This is not approval evidence, so the PR is blocked until a source-backed review can establish approval sufficiency or identify concrete fixes.

Findings

1. HIGH .jules/bolt.md:1 - OpenCode could not establish approval sufficiency

  • Problem: every configured model path failed to produce a usable current-head control block.
  • Root cause: model execution, timeout, export, normalization, or approval-gate validation did not complete after exponential retry across the configured model pool.
  • Impact: approving from deterministic check state alone would miss PR-intent mismatches, missing files, edge-case bugs, robustness gaps, UX/DX regressions, security issues, and CodeGraph-backed base/head flow changes.
  • Fix: rerun OpenCode after model availability recovers, or update the PR with the missing files, tests, docs, generated artifacts, and verification evidence needed for a source-backed review conclusion.
  • Regression test: keep the approval gate posting REQUEST_CHANGES, not APPROVE or check-only failure, when no model produces a valid current-head review.

Summary

  • Result: REQUEST_CHANGES
  • Reason: coverage-evidence passed and peer GitHub Checks completed without failures, but no model produced a valid review control block.
  • Deterministic evidence checked but not used for approval: current-head changed-file evidence (.jules/bolt.md, CHANGELOG.md, i18n.js, test_i18n.html); coverage-evidence result success; peer checks from statusCheckRollup excluding this OpenCode check.
  • Model outcome: model_pool=exhausted; selected_model=none.
  • Head SHA: 585a8e554494f869ce102488241fb19c79359e55
  • Workflow run: 28459522908
  • Workflow attempt: 1

No PR approval was posted because model-output failure is not evidence that the PR has no blockers.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test_i18n.html"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_i18n.html"]
  R2 --> V2["targeted test run"]
Loading

Comment thread .jules/bolt.md
## 2024-06-20 - Unnecessary initial DOM updates for default language
**Learning:** The simple static i18n implementation runs `node.textContent = dict[node.dataset.i18n]` for every translatable node on the initial script load, even when the HTML is already written in the target language (Korean). This creates unnecessary layout/paint operations and blocking time on the main thread for elements that don't need text changes.
**Action:** Always check if the current value matches the desired value before updating the DOM (`node.textContent !== newText`), and add early exits when setting state to the same value to avoid redundant DOM traversal and writes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

HIGH OpenCode could not establish approval sufficiency

  • Problem: the model pool exhausted without a valid current-head review control block, so this changed line cannot be approved from deterministic check state alone.
  • Impact: PR-intent mismatches, missing files, robustness bugs, UX/DX regressions, and CodeGraph-backed flow changes could be missed.
  • Fix: rerun OpenCode after model availability recovers, or add the missing source/test/docs/generated verification evidence needed for a source-backed approval.
  • Verification: rerun the OpenCode Review workflow and confirm it emits APPROVE or source-backed REQUEST_CHANGES for this head SHA.

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