perf(victory-gpu): use RwLock for early pipeline tracking and avoid Call string formatting #416
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!416
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-416"
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?
@Lewandox on GitHub · 2026-11-26 18:00 UTC · original
Lewandox:perf/victory-gpu-pipeline-library→main· +104 −18 · 1 files · 2 commits · merged 2026-11-26 18:52 UTCSummary
Removes unnecessary heap allocations and mutex contention on the hot pipeline-library lookup/creation path while keeping identical
removal_note()diagnostics on device removal.Changes
USED(wanted_early/note_used) —RwLock+ zero-allocation check:USEDfromMutex<Option<HashSet<String>>>toRwLock<Option<HashSet<String>>>with lazy initialization helperensure_used().wanted_early(key)now takes a shared read lock instead of an exclusive mutex.note_used(key)checks membership and theEARLY_MAXcap under a shared read lock first, returning immediately with zero write lock and zerokey.to_owned()heap allocation once a pipeline key has been seen.Call/CALLS— deferred string formatting & inline pipeline names:LABELasArc<str>instead of cloning a heapStringon everycall().CallName(Inline([u8; 32], u8)/Heap(String)) so 32-byte pipeline hash keys do not allocate on the heap duringcall("load" | "make" | "store", name).format!("{name} {label}")so formatting only happens insideremoval_note()if a device removal actually occurs.Tests:
CallNameinline/heap storage,Callformatting inremoval_note(), andwanted_early/note_usedbehavior.Verification
cargo test -p victory-gpu --lib pipeline::library::tests(default and--features diagnostics)cargo xtask policy