Improved performance and reduced memory usage - #1238
Merged
Conversation
* master: updated benchmark tests added repeats and updates options to test tools added Example.stress4 added arrow key navigation of examples in development demo reduce canvas hit testing in demo when using matter-tools
|
Just to say that I merged this PR into the version of Matter I use with Phaser and it worked great in all of my tests except one: When sleeping is enabled, collisions between sleeping bodies get removed from the Pairs list too early and things start to fall through each other / the world. I noticed there was a fix for this in #1079 but it wasn't included in this PR so I think gets lost? |
Owner
Author
|
@photonstorm thanks for taking a look - I've pushed an update re. sleeping bodies here, hopefully that covers it? |
Owner
Author
|
@photonstorm I've just pushed a couple more changes to handle pair removal in composite removal cases, that might be the last part here so I think I'll get this merged soon but feel free to let me know if you spotted anything else on this. |
* master: bump package lock improve test comparison report fixed compare tool layer order in demo testbed
* master: update ci update ci
* master: improve test comparison report
|
woot |
Merged
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.
This PR focuses on performance improvements around memory usage.
Scenes with a large number of colliding pairs will benefit most from these changes.
On the
stress3, stress4examples using thebenchmarkcommand in Node running on my Mac M1 Air:Other examples show smaller improvements as they tend to have a much lower number of colliding pairs.
Changes
Pairs.updatePair.idformatcollision.supportsas belowMigration
Matter.Collisionusecollision.supportCountinstead ofcollision.supports.lengthfor active supportsMatter.Pairusepair.contactsinstead ofpair.activeContactsMatter.Pairusepair.contactCountinstead ofpair.contacts.lengthfor active contactsPair.idformat has changed