perf(device): pop retired deletions off the front in O(ready) (#116) #135
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics!135
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/issue-116"
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?
Summary
Device::ReclaimDeletionsis called once per frame (Window.cpp:802) and did an O(n) walk over the whole deletion queue plus an in-place survivor compaction.frameCounteris monotonic, soretireAfteris non-decreasing down the queue and the entries ready to reclaim are always a contiguous prefix.This switches
deletionQueuefromstd::vectortostd::dequeand pops the ready prefix off the front, stopping at the first entry still in flight (everything behind it is newer, hence also in flight) — O(ready) instead of O(queue).Minor in practice (the queue is empty in steady state), but removes the per-frame full-queue scan.
Testing
crafter-build test --jobs=1→ 20 passed, including the deletion-queue testsDeferredDeletionandMeshDecompressStagingReleasewhich pin the exact retire-frame timing on a real headless Vulkan device.(Note: parallel
crafter-build testflakes in this sandbox due to concurrentgit pullraces on the shared external-dep cache — unrelated to this change; serial runs are green.)Resolves #116