Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@eyeseet
Copy link

@eyeseet eyeseet commented Aug 11, 2020

Loop only non-static/non-sleeping bodies 8 times instead of all bodies. At the cost of one extra loop in Engine.update. Estimate is improved performance when >12% of bodies is sleeping or static.

…static/non-sleeping bodies 8 times instead of all bodies. At the cost of one extra loop in Engine.update. Estimate is improved performance when >12% of bodies is sleeping or static.
@eyeseet
Copy link
Author

eyeseet commented Aug 11, 2020

From what I understand from the documentation https://brm.io/matter-js/docs/classes/Body.html#property_isSleeping static bodies can be threaded as if sleeping and vice versa. In this case further optimizations are possible such as:

  • Sleeping.update function.
  • Only one array to track either sleeping or static bodies (instead of one for each) in Engine.update.
  • Also several check in the loops of the methods that get bodies passed as parameter can be improved.

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.

1 participant