perf(victory-gpu): reuse overlay PDH/UTF-16 buffers and harden frametime tests #420
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!420
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-420"
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:04 UTC · original
Lewandox:perf/victory-gpu-overlay-and-frametime→main· +227 −91 · 2 files · 2 commits · merged 2026-11-26 18:37 UTCSummary
Eliminates recurring heap allocations in the performance overlay (
overlay.rs) and adds overflow-safe interval timing, stack-buffered NVIDIA driver parsing, and regression tests forframetime.rs.Changes
overlay.rs— reusable PDH buffer & stack UTF-16 encoding:buf: Vec<u64>insideGpu3dsoGpu3d::percent(&mut self)reuses its PDH counter buffer across 500 ms samples instead of allocating a freshVec<u64>on every tick; addedDrop for Gpu3dto close the PDH query handle cleanly.with_utf16([u16; 128]withVec<u16>fallback) andGdi::measure_widesoGdi::measureavoids heap allocation for overlay lines andGdi::drawencodes UTF-16 once instead of twice.with_utf16(ASCII, Unicode, surrogate pairs, >128 fallback).frametime.rs— overflow safety, zero-format!driver parsing, & regression tests:as_micros() as u64truncation intick()with saturatingu64::try_from(...).unwrap_or(u64::MAX)andsaturating_addaccounting.format!("{third}{fourth}")andStringdigit collection innvidia_driver_number()using a 5-byte rolling stack buffer.summarize_intervalandformat_rowand added comprehensive unit tests covering zero/single/spike intervals,u64::MAXsaturation, NVIDIA driver parsing edge cases, and CSV column-count parity againstHEADER.Verification
cargo test -p victory-gpu --lib overlay::tests(default and--features diagnostics)cargo test -p victory-gpu --lib frametime::tests(default and--features diagnostics)cargo xtask policy