[perf] ReclaimDeletions compacts the whole deletion queue every frame (Device.cpp) #116
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#116
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-Device.cpp:1012-1028Severity: low · Effort: moderate · Category: cpu
Problem
ReclaimDeletionsis called once per frame (Window.cpp:802) and does an O(n) walk + survivor copy over the whole deletion queue.retireAfteris monotonic, so the ready entries are always a prefix.Fix
Ring buffer /
deque::pop_frontwhile the front is retired → O(ready). Minor in practice: the queue is empty in steady state and entries are 24 B contiguous.