Skip to content

Improve BroadPhase performance#519

Closed
neondev9 wants to merge 2 commits intoerincatto:masterfrom
neondev9:master
Closed

Improve BroadPhase performance#519
neondev9 wants to merge 2 commits intoerincatto:masterfrom
neondev9:master

Conversation

@neondev9
Copy link

Tumbler 5 minutes test:
Before; 1.03 (Average)
After: 0.71 (Average)

@neondev9
Copy link
Author

Solution: clean the tree from invalid leaves(moved proxies), check the invalid leaf with the tree and reinsert leaf into the tree only after that.
There are absolutely no duplicates for each step of the broadphase.

@erincatto
Copy link
Owner

Sorry, it took me so long to look at this. I'm not sure this will work because it leaves the tree in an invalid state. So if somebody calls b2Body::SetTransform and then performs a raycast then they will get the wrong result. This sort of optimization might be useful if restricted to the world step. I'm guessing the main performance issue is the call to std::sort. I think we could avoid this by comparing the proxy ids.

@erincatto
Copy link
Owner

See #589

@erincatto erincatto closed this Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants