Skip to content

⚡ Bolt: computeTaskMetrics 루프 성능 최적화 - #590

Closed
seonghobae wants to merge 2 commits into
developfrom
bolt/optimize-compute-metrics-loops-15962930833515522622
Closed

⚡ Bolt: computeTaskMetrics 루프 성능 최적화#590
seonghobae wants to merge 2 commits into
developfrom
bolt/optimize-compute-metrics-loops-15962930833515522622

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

💡 무엇을
app.js 파일 내의 computeTaskMetrics 함수에서 Array.prototype.reduce, Array.prototype.forEach 등의 배열 메소드와 Map 캐싱 구조를 표준 for 루프와 Int32Array 캐싱 구조로 변경했습니다.

🎯 왜
computeTaskMetrics는 화면 렌더링을 포함해 상태가 변경될 때마다 호출되는 함수로, 수많은 tasks 배열을 반복 처리합니다. 반복 처리 과정에서 JS 엔진의 콜백 할당, 가비지 컬렉션(GC) 그리고 Map 해시 조회에 따른 오버헤드가 발생하기 때문에, 이를 표준 루프와 타입 지정 배열(Typed Array)로 최적화하면 큰 성능 향상을 가져올 수 있습니다.

📊 영향

  • O(N) 순회 시 콜백 함수 할당과 해시맵 조회에 의한 오버헤드가 제거되어, 전체 메트릭스 계산 시간이 단축됩니다.
  • 가비지 컬렉션(GC) 발생 빈도가 낮아져 끊김 없는 UI 경험을 제공할 수 있습니다.

🔬 측정

  • Int32Array 및 표준 for 루프를 사용한 함수로 성능 벤치마크 혹은 브라우저 프로파일링 도구에서 computeTaskMetrics 실행 시간이 단축된 것을 확인할 수 있습니다.
  • 변경 전과 동일하게 E2E 및 단위 테스트가 모두 정상 통과하는지 확인했습니다. (기존 테스트 제외 모두 성공)

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


Open in Devin Review

Replaced `Array.prototype.reduce`/`forEach` and `Map` cache structures with standard `for` loops and `Int32Array` in high-frequency path `computeTaskMetrics`. This eliminates JS engine callback allocations, garbage collection overhead, and Map hash-lookup overhead.
@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 Aug 23, 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: 20 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3523d25a-dd70-4330-aa90-e072bd296fb5

📥 Commits

Reviewing files that changed from the base of the PR and between 2c32887 and 71e856d.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • app.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread app.js
Comment on lines 1413 to +1416
plannedDateWarning,
actualDateWarning
});
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Int32Array cache preserves behavior

Switching from a task.id-keyed Map to a position-indexed Int32Array stays correct: both loops iterate state.tasks in the same order, and calculateDurationDays returns only integers within Int32 range under YYYY-MM-DD validation. As a side effect it avoids the prior collapse of duplicate task ids in the Map.

(Refers to this code)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #508 after a fresh semantic diff comparison against the same protected develop@2c328875e00e86537df3e965170be80532571cad baseline. Both PRs implement the same computeTaskMetrics() root change: replace the duration Map plus callback-heavy reduce/forEach passes with index-aligned Int32Array storage and indexed loops. #508 preserves that implementation and additionally carries the missing acceptance/evidence surface: deterministic 10,000-task browser benchmarking against an immutable base revision, exact semantic fingerprint equality, a >=15% median improvement gate, fail-closed benchmark-base resolution, focused unit coverage, and normal CI registration. #590 contributes no unique product/runtime behavior beyond that already-preserved implementation, so keeping both open would create competing ownership of the same hot path and duplicate review/CI work.

@seonghobae seonghobae closed this Aug 23, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing as superseded by #508 after a fresh semantic diff comparison against the same protected develop@2c328875e00e86537df3e965170be80532571cad baseline. Both PRs implement the same computeTaskMetrics() root change: replace the duration Map plus callback-heavy reduce/forEach passes with index-aligned Int32Array storage and indexed loops. #508 preserves that implementation and additionally carries the missing acceptance/evidence surface: deterministic 10,000-task browser benchmarking against an immutable base revision, exact semantic fingerprint equality, a >=15% median improvement gate, fail-closed benchmark-base resolution, focused unit coverage, and normal CI registration. #590 contributes no unique product/runtime behavior beyond that already-preserved implementation, so keeping both open would create competing ownership of the same hot path and duplicate review/CI work.

Understood. Acknowledging that this work is now superseded by #508 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.

1 participant