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

Flip writeback to iterate over rapier's bodies #432

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Aceeri
Copy link
Sponsor Contributor

@Aceeri Aceeri commented Sep 27, 2023

Unsure of whether this will have a noticeable performance improvement currently. I would like to do some benchmarks on how writeback performs.

I think the bigger thing here would be to not use bevy's transform propagation/GlobalTransform and instead adapt it to our case where we update a PhysicsTransform that is more akin to the old pre-0.8 bevy GlobalTransform. This would also allow us to not update unrelated entities.

@Aceeri Aceeri marked this pull request as draft September 28, 2023 14:02
@Aceeri
Copy link
Sponsor Contributor Author

Aceeri commented Sep 28, 2023

It seems that this gives a ~22% performance increase in the writeback system when profiling the boxes3 example. So seems worthwhile from initial benchmarks.

@Aceeri Aceeri marked this pull request as ready for review September 28, 2023 15:32
@sebcrozet
Copy link
Member

sebcrozet commented Sep 30, 2023

Thank you for this PR! Is there a particular reason why the .tracy files were pushed?

I’m very surprised this improves performances. Doesn’t bevy recommend iterating on bodies rather than random access through Query::get? Does bevy’s Query::iter_mut involves a large overhead?

@Aceeri
Copy link
Sponsor Contributor Author

Aceeri commented Oct 3, 2023

.tracy files were unintentional sorry about that!

Yeah I wasn't expecting this to do anything honestly, I was just testing this out for the sake of the TODO comment. I'll probably investigate a bit more later on because realistically this shouldn't have any performance effect.

@Vrixyz Vrixyz added D-Difficult Needs strong technical background, domain knowledge, or impacts are high, needs testing... P-High arbitrary important item A-Integration very bevy specific enhancement New feature or request labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Integration very bevy specific D-Difficult Needs strong technical background, domain knowledge, or impacts are high, needs testing... enhancement New feature or request P-High arbitrary important item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants