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

Fix performance issues and introduce Performance example #40

Merged
merged 11 commits into from
Jul 6, 2020

Conversation

marcofugaro
Copy link
Member

@marcofugaro marcofugaro commented Jun 27, 2020

To fix the performance issues I've reintroduced the check on substepping that was removed in 86b0444 and introduced the changes from schteppe#392, which don't let the accumulator grow overtime.

I also introduced a new performance.html example, which I used to do the tests.

When jank is introduced, the simulation should stutter but still have a fixed timestep, it should not play in slow-motion.

When there is too much stuff going on for javascript to handle (500 boxes), I've set the minimum framerate at 10fps 30fps, which is a good compromise between time-correct simulation and playable fps. This can of course adjusted by the user using the maxSubSteps parameters.

Screenshot 2020-06-27 at 13 14 25

(NOTE: the example is rotated until PR #34 is merged and Demo.js is updated)

This should close #16
This should close #36

⚠️ Please test that those fps issues don't happen anymore before merging.

@codynova
Copy link
Member

codynova commented Jul 6, 2020

Awesome job hunting this down and fixing it, this is a huge deal as far as features go. 💥💥💥 We should advertise this heavily in the readme. From what I can tell this is working excellently based on my testing in #16 and #36 (and after merging #41). I'm going to release this, there really isn't much risk even if everything were to break.

@codynova codynova merged commit b60b86c into master Jul 6, 2020
@marcofugaro
Copy link
Member Author

Thanks! 🙂
Glad to know your tests went okay!!

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.

Performance regression World.step is buggy when attempting to account for variable framerate
2 participants