[perf] FontAtlas dirty-rect uses one union bounding box (FontAtlas.cpp) #129

Closed
opened 2026-06-17 21:18:55 +02:00 by jorijnvdgraaf · 0 comments

Found by an adversarially-verified performance audit (confirmed real after a skeptic pass).

Location: implementations/Crafter.Graphics-FontAtlas.cpp:137-163
Severity: low · Effort: moderate · Category: memory

Problem

The dirty-rect uses a single union bounding box. Scattered new glyphs on different shelves produce a tall union box that uploads mostly-unchanged texels. Warmup-only (glyphs are write-once; steady state bails on !dirty).

Fix

Track a small per-shelf dirty-span list and issue multiple tight UpdateRegion copies. Low priority unless warmup stalls are observed.

Found by an adversarially-verified performance audit (confirmed real after a skeptic pass). **Location:** `implementations/Crafter.Graphics-FontAtlas.cpp:137-163` **Severity:** low · **Effort:** moderate · **Category:** memory ### Problem The dirty-rect uses a single union bounding box. Scattered new glyphs on different shelves produce a tall union box that uploads mostly-unchanged texels. Warmup-only (glyphs are write-once; steady state bails on `!dirty`). ### Fix Track a small per-shelf dirty-span list and issue multiple tight `UpdateRegion` copies. Low priority unless warmup stalls are observed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Catcrafts/Crafter.Graphics#129
No description provided.