Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
## 2026-07-12 - Optimize renderTaskRow DOM allocations
**Learning:** Caching unattached template nodes and instantiating them via `.cloneNode(false)` reduces DOM instantiation overhead in O(N) render loops significantly.
**Action:** Apply this optimization to other hot-path rendering elements such as rows, cells, and stack containers.
## 2026-07-25 - DOM element configuration caching
**Learning:** Repeatedly creating and configuring small DOM elements with multiple attributes (class, style, title, textContent) during O(N) loops incurs noticeable JS-to-C++ allocation overhead.
**Action:** Pre-configure common static elements in a Map by their identifying key and instantiate them using \`.cloneNode(true)\` to bypass property assignment overhead.
44 changes: 30 additions & 14 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,35 +951,51 @@ function createWarningBadge(warning) {
}

const persistentOwnerColorMap = new Map();
// ⚡ Bolt: Cache fully constructed owner badge DOM nodes to avoid redundant property assignment overhead
const ownerBadgeTemplateCache = new Map();
Comment on lines 953 to +955

function createOwnerCellContent(owner) {
if (!owner) {
return createEmptyCell();
}

if (!persistentOwnerColorMap.has(owner)) {
persistentOwnerColorMap.set(owner, OWNER_COLORS[persistentOwnerColorMap.size % OWNER_COLORS.length]);
let badgeTemplate = ownerBadgeTemplateCache.get(owner);
if (!badgeTemplate) {
if (!persistentOwnerColorMap.has(owner)) {
persistentOwnerColorMap.set(owner, OWNER_COLORS[persistentOwnerColorMap.size % OWNER_COLORS.length]);
}
badgeTemplate = document.createElement('span');
badgeTemplate.className = 'owner-badge';
badgeTemplate.style.background = persistentOwnerColorMap.get(owner);
badgeTemplate.textContent = owner;
ownerBadgeTemplateCache.set(owner, badgeTemplate);
}

const badge = document.createElement('span');
badge.className = 'owner-badge';
badge.style.background = persistentOwnerColorMap.get(owner);
badge.textContent = owner;
return badge;
return badgeTemplate.cloneNode(true);
}

// ⚡ Bolt: Cache fully constructed status badge DOM nodes to avoid redundant property assignment overhead
const statusBadgeTemplateCache = new Map();
Comment on lines +977 to +978

function createStatusCellContent(progressState) {
if (!progressState.label) {
return createEmptyCell();
}
const badge = document.createElement('span');
badge.className = `status-badge ${progressState.className}`;
badge.textContent = progressState.label;
if (progressState.description) {
badge.title = progressState.description;
badge.setAttribute('aria-label', `${progressState.label} - ${progressState.description}`);

const cacheKey = `${progressState.label}|${progressState.className}|${progressState.description || ''}`;
let badgeTemplate = statusBadgeTemplateCache.get(cacheKey);
Comment on lines +985 to +986
if (!badgeTemplate) {
badgeTemplate = document.createElement('span');
badgeTemplate.className = `status-badge ${progressState.className}`;
badgeTemplate.textContent = progressState.label;
if (progressState.description) {
badgeTemplate.title = progressState.description;
badgeTemplate.setAttribute('aria-label', `${progressState.label} - ${progressState.description}`);
}
statusBadgeTemplateCache.set(cacheKey, badgeTemplate);
}
Comment on lines +985 to 996
return badge;

return badgeTemplate.cloneNode(true);
}

const metricTextTemplate = document.createElement('span');
Expand Down
14 changes: 14 additions & 0 deletions commit_message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
⚡ Bolt: [성능 개선] 상태 및 담당자 배지 DOM 렌더링 최적화

💡 무엇을
- `createOwnerCellContent` 및 `createStatusCellContent` 함수에 DOM 템플릿 캐싱(Map) 적용
- O(N) 테이블 렌더링 루프에서 반복적인 요소 생성(`document.createElement`) 및 속성 할당 대신 `.cloneNode(true)` 사용

🎯 왜
- 수백/수천 개의 작업 행을 렌더링할 때 각 셀마다 작은 DOM 요소들의 속성(class, style, title, textContent)을 매번 JS-to-C++ 브릿지를 통해 할당하면 누적된 메모리 할당 및 실행 시간 지연(overhead)이 발생하기 때문입니다.

📊 영향
- 담당자(Owner) 배지 및 실적상태(Status) 배지 생성 시 중복된 DOM 인스턴스화 오버헤드가 감소하여 대규모 WBS 테이블의 렌더링 속도와 프레임 드롭 개선

🔬 측정
- `pnpm run test:api`, `pnpm run test:unit`, `pnpm run test:e2e` 를 통해 모든 기능 정상 작동 검증 완료
Loading