Skip to content
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

v1.0.1 significant performance decrease compared to v1.0.0 #66

Open
Fxlr8 opened this issue Dec 27, 2019 · 3 comments
Open

v1.0.1 significant performance decrease compared to v1.0.0 #66

Fxlr8 opened this issue Dec 27, 2019 · 3 comments

Comments

@Fxlr8
Copy link

Fxlr8 commented Dec 27, 2019

Hi, I have just updated my game backend to a newer version of box2d.ts and the performande dropped a lot. I do a lot of QueryAABB and fixture.synchronize calls for my game's needs. I noticed that Solve takes more CPU now and GC became more aggressive.

v1.0.0
image
v1.0.1
image

The game code is the same in both cases. The game is playable on v1.0.0, but on v1.0.1 heavy lags appear because the server can't output enough frames per second.

@flyover
Copy link
Owner

flyover commented Dec 27, 2019

In this version, there was a change to b2Body:SynchronizeFixtures that uses the center of mass instead of the transform position. This may be causing the proxy AABB's to be updated more often. I'm not sure what might be causing the GC. I recall using for..of loops for iterating in some places; perhaps this is generating garbage. I'll have to look into it further. For now, you might consider switching back to 1.0.0.

@jcyuan
Copy link

jcyuan commented Sep 25, 2020

https://stackoverflow.com/questions/18364175/best-practices-for-reducing-garbage-collector-activity-in-javascript

@flyover hi, FYI.

@Lusito
Copy link

Lusito commented Oct 2, 2020

Did some digging. The biggest performance drop comes from moving the math stuff to Float32Array.

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

No branches or pull requests

4 participants