-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Optimize rendering slow-down at high entity counts #5509
[Merged by Bors] - Optimize rendering slow-down at high entity counts #5509
Conversation
Wow yeah thats a big win right there. Pretty sure this is valid. I'll give this a proper think asap. |
038f2a5
to
a5f8c03
Compare
Changed again to a fully custom flush method that directly uses memset, this is getting even larger gains. |
Currently UB, working on a fix. |
Reverted the memset, so this works again, but others investigating why the memset version failed via UB would be appreciated. |
UB fixed with help from @PROMETHIA-27 |
b02a1d7 (repro from issue) |
@@ -14,6 +14,7 @@ use std::{ | |||
}; | |||
|
|||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] | |||
#[repr(transparent)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably makes sense to add a comment to ArchetypeId::INVALID
saying that it must be equivalent to setting all bytes of memory to u8::MAX
(and referencing flush_and_reserve_invalid). Don't want anyone changing this here and then implicitly breaking flush_and_reserve_invalid.
I'm excited for this PR as it seems like it fixes part of the performance issues here! I'm still worried that this isn't a complete fix though. |
Just checking on the general status of this PR. I noticed it was removed from the 0.8.1 release. Curious as to when we might expect this to be part of mainline. Thanks! |
bors r+ |
# Objective - Improve #3953 ## Solution - The very specific circumstances under which the render world is reset meant that the flush_as_invalid function could be replaced with one that had a noop as its init method. - This removes a double-writing issue leading to greatly increased performance. Running the reproduction code in the linked issue, this change nearly doubles the framerate. Co-authored-by: Carter Anderson <mcanders1@gmail.com>
# Objective - Improve bevyengine#3953 ## Solution - The very specific circumstances under which the render world is reset meant that the flush_as_invalid function could be replaced with one that had a noop as its init method. - This removes a double-writing issue leading to greatly increased performance. Running the reproduction code in the linked issue, this change nearly doubles the framerate. Co-authored-by: Carter Anderson <mcanders1@gmail.com>
# Objective - Improve bevyengine#3953 ## Solution - The very specific circumstances under which the render world is reset meant that the flush_as_invalid function could be replaced with one that had a noop as its init method. - This removes a double-writing issue leading to greatly increased performance. Running the reproduction code in the linked issue, this change nearly doubles the framerate. Co-authored-by: Carter Anderson <mcanders1@gmail.com>
# Objective - Improve bevyengine#3953 ## Solution - The very specific circumstances under which the render world is reset meant that the flush_as_invalid function could be replaced with one that had a noop as its init method. - This removes a double-writing issue leading to greatly increased performance. Running the reproduction code in the linked issue, this change nearly doubles the framerate. Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Objective
Solution
Running the reproduction code in the linked issue, this change nearly doubles the framerate.