Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Enumerate Query Pool properly #10

Merged
merged 1 commit into from
Jan 24, 2024
Merged

Vulkan: Enumerate Query Pool properly #10

merged 1 commit into from
Jan 24, 2024

Conversation

ryzendew
Copy link
Owner

Turns out that ElementAt for Queue runs the default implementation as it doesn't implement IList, which enumerates elements of the queue up to the given index. This code was creating count enumerators and iterating way more queue items than it needed to at higher counts. The solution is just to use one enumerator and break out of the loop when we get the count that we need.

3.5% of backend time was being spent just enumerating at the usual spot in SMO.

Turns out that ElementAt for Queue<T> runs the default implementation as it doesn't implement IList, which enumerates elements of the queue up to the given index. This code was creating `count` enumerators and iterating way more queue items than it needed to at higher counts. The solution is just to use one enumerator and break out of the loop when we get the count that we need.

3.5% of backend time was being spent _just_ enumerating at the usual spot in SMO.
@ryzendew ryzendew merged commit 5dcad74 into ryzendew:Buildtest Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants