[perf] shapedRuns_ eviction is all-or-nothing clear() at cap (UI-Shared.cpp) #123
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by an adversarially-verified performance audit (confirmed real after a skeptic pass).
Location:
implementations/Crafter.Graphics-UI-Shared.cpp:112-113Severity: medium · Effort: moderate · Category: algorithmic
Problem
At
kMaxShapedRuns(8192) the cache does a fullclear(). A stream of unique strings (FPS counters, timers) alongside many stable labels periodically nukes all stable entries, forcing a full-UI reshape on the next frame.Fix
LRU / last-used-frame stamp + evict-oldest, keeping the hot set resident. Needs an auxiliary usage structure alongside the map. (Related to GPU-atlas eviction issue #55, but distinct — this is the CPU-side shaped-run cache.)
Verification
Confirm this actually improves net peformance.