Wide threads: the processor count is worked out once, not at every spread of work #3570
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3570
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3570"
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?
@tphira612 on GitHub · 2026-11-30 01:13 UTC · original
tphira612:perf/wide-threads-once→main· +16 −7 · 1 files · 1 commits · closed without mergingWhat it changes
wide_threads()inshadow.rscached onlyVICTORY_WIDE_THREADS. Without it (the default), every call askedstd::thread::available_parallelism()again.queued,wide_eachandwide_each_scopedcall it one to three times per spread of work, on the submitting thread. On Windows that call asks the system for the process's affinity and job limits each time.The count is now worked out once in the
OnceLock. The value, the clamps and the switch are unchanged. The helper threads are started once with this count anyway.How it was tested
cargo test --locked -p victory-gpu --lib:shadow::wide_testspass. Two failures are not from this change:every_switch_of_the_translator_is_in_the_keyalso fails onmain, anda_change_is_saved_at_once_however_the_game_was_startedpasses when run alone.cargo build --release --locked -p victoryandcargo xtask policy --stagedpass. Clippy is clean invictory-gpu; it stops onvictory-shadererrors already onmain(fixed by #3560, #3530, #3385).7d04a35d14to4667446df6Pull request closed