DescriptorPool: O(1) recycled-descriptor accounting in available()#1724
Open
nolankramer wants to merge 1 commit into
Open
DescriptorPool: O(1) recycled-descriptor accounting in available()#1724nolankramer wants to merge 1 commit into
nolankramer wants to merge 1 commit into
Conversation
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.
Description
available()walked the entire_recyclingListon every call to tally up the descriptors held in freed sets. Under high churn, scenes that stream in and evict a lot of geometry freed thousands of per-object descriptor sets. That list gets long, and sinceDescriptorPools::reserve()callsavailable()once per pool, compile time scales with the number of recycled sets. I saw it ramp past 10ms and stay there after a big spike.This fix keeps a running per-type total of what's in the recycling list, updated as sets are freed and reused, so
available()just reads it. O(number of descriptor types) instead of O(recycled sets).Does not change behavior - strictly a performance improvement for scenes the churn descriptor sets rapidly.
Also added a quick doc string to
compile()andcompileTask()that they don't throw, and users should instead expect to read the returnedCompileResultType of change
Please delete options that are not relevant.
How Has This Been Tested?
In my own app - works as-expected.
Test Configuration:
Checklist: