-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Improved performance and reduced memory usage #1238
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? |
@photonstorm thanks for taking a look - I've pushed an update re. sleeping bodies here, hopefully that covers it? |
@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 |
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, stress4
examples using thebenchmark
command 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.update
Pair.id
formatcollision.supports
as belowMigration
Matter.Collision
usecollision.supportCount
instead ofcollision.supports.length
for active supportsMatter.Pair
usepair.contacts
instead ofpair.activeContacts
Matter.Pair
usepair.contactCount
instead ofpair.contacts.length
for active contactsPair.id
format has changed