perf(victory-formats): reuse capped thread-local decode scratch and history buffers in bcpack #408
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!408
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-408"
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 17:50 UTC · original
Lewandox:perf/bcpack-reuse-decode-buffers→main· +125 −32 · 1 files · 1 commits · closed without mergingSummary
Eliminates repeated per-decode heap allocations and zero-fills in
victory_formats::bcpack::decode(third_party/victory/crates/victory-formats/src/bcpack.rs):decode()previously allocated and zeroedvec![0u8; blocks * stride]on every BCPack texture decode (up to multi-MiB per decode on DirectStorage worker threads).RECORDS_SCRATCHbuffer (capped atRECORDS_CAP = 4 MiBon exit so oversized decodes immediately return RAM to the OS).plain,bc6,bc7):plain(),bc6(), andbc7()previously allocated a freshvec![...; HISTORY]on every decode call. Sincepick(i, r, history, ...)only readshistory[(i - r) % HISTORY]forr <= i, reusing the fixed-size per-thread history buffers produces bit-identical output with zero per-call heap allocations.with_records_scratchreuses allocations up toRECORDS_CAP, drops oversized buffers on exit, and preserves identical output across consecutive decodes.Verification
cargo test -p victory-formats --lib bcpackcargo xtask policyinsidethird_party/victory@LooperSalty on GitHub · 2026-11-26 23:09 UTC · original
Closing after #454 moved
third_party/victoryto the Vice-Tay base (TaynanGT/Vice-Tay a252348).The change came without a measurement (rule 2 of AGENTS.md asks for one for performance work).
Thanks for the work. If you measure a gain on the new base, a new PR against
mainis welcome.🤖 Closed by Claude Code on behalf of the maintainer
Pull request closed