hex-engine icon indicating copy to clipboard operation
hex-engine copied to clipboard

Performance with many physics objects

Open ianobermiller opened this issue 4 years ago • 4 comments

I noticed that after adding a dozen circles that collide the rendering slows down considerably. matter.js appears to be able to handle much more than this, so I don't think the problem is the underlying physics lib. It looks like it is caused by useEntitiesAtPoint doing a ton of matrix operations.

Sample repo: https://github.com/ianobermiller/jezzball-in-hex

ianobermiller avatar Mar 04 '20 04:03 ianobermiller

Thank you for opening this!

suchipi avatar Mar 08 '20 01:03 suchipi

This should be improved in @hex-engine/[email protected]. Could you take a look?

suchipi avatar Mar 08 '20 03:03 suchipi

That definitely helps! There are still issues with 50-100 balls but it is better.

ianobermiller avatar Mar 10 '20 00:03 ianobermiller

I'll keep this issue open, because there are other improvements I want to make.

suchipi avatar Mar 10 '20 00:03 suchipi