Return a descriptor heap's host heap without a lock once it exists #27

Manually merged
github merged 1 commit from gh-pr/27/head into gh-pr/27/base 2026-11-26 03:33:27 +00:00
Owner

@⁠romainhedouin on GitHub · 2026-11-25 12:32 UTC · original
romainhedouin:perf/heap-host-fast-path → main · +5 −0 · 1 files · 1 commits · merged 2026-11-25 17:09 UTC

Every draw asks descriptor heaps for their host heap several times, and each ask took a mutex, even long after the host heap was made. That mutex only protects writes queued before the host heap exists, and nothing is queued after that, so the ask now returns right away once the heap is made.

Per ask, once the host heap exists Before After
Mutex locks 1 0
Model benchmark (same lock pattern, one thread) 10.9–15.2 ns 2.0–2.5 ns

"Model benchmark" = the same logic copied into a standalone program and timed in release mode on a Mac, not in the game. Type-checked for Windows (cargo clippy --target x86_64-pc-windows-msvc, with and without --all-features, no new warnings); not run.

🤖 Generated with Claude Code

**@⁠romainhedouin** on GitHub · 2026-11-25 12:32 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/27) `romainhedouin:perf/heap-host-fast-path` → `main` · +5 −0 · 1 files · 1 commits · merged 2026-11-25 17:09 UTC Every draw asks descriptor heaps for their host heap several times, and each ask took a mutex, even long after the host heap was made. That mutex only protects writes queued before the host heap exists, and nothing is queued after that, so the ask now returns right away once the heap is made. | Per ask, once the host heap exists | Before | After | |---|---|---| | Mutex locks | 1 | 0 | | Model benchmark (same lock pattern, one thread) | 10.9–15.2 ns | 2.0–2.5 ns | "Model benchmark" = the same logic copied into a standalone program and timed in release mode on a Mac, not in the game. Type-checked for Windows (`cargo clippy --target x86_64-pc-windows-msvc`, with and without `--all-features`, no new warnings); not run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:33:27 +00:00
github manually merged commit b022d86024 into gh-pr/27/base 2026-11-26 03:33:27 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.