Repository navigation
perf(shader): flat open-addressing cache in the SRT evaluator - #421
Closed
MichonGoddijn231849 wants to merge 1 commit into
Closed
MichonGoddijn231849 wants to merge 1 commit into
MichonGoddijn231849 wants to merge 1 commit into
Conversation
The resource walk memoizes every evaluated IR value. An unordered_map allocated a node per value; a power-of-two open-addressing table keyed on the value pointer does not. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Closing as a duplicate of #415, which does the same flat-table memo (and inlines the IrValue accessors on top). Sorry for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The SRT resource walk memoizes the value of every IR instruction it evaluates, so each value is computed once per capture. The memo was a
std::unordered_map<IrValue*, std::uint64_t>, which allocates a node per value and hashes through the standard library. It is now a small open-addressing table: power-of-two slots keyed by the value pointer, growing at 75% load. No per-value allocation, and the same results.Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
ctest: all tests pass.APS5_PROFILE_DRAW=1: the capture walk dropped from 6.7 to 4.4 µs per capture, at about 190k captures per 10 s. Measured on my branch that combines this change with my other open PRs.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository🤖 Generated with Claude Code