Fix performance issues and introduce Performance example #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
10fps30fps, which is a good compromise between time-correct simulation and playable fps. This can of course adjusted by the user using themaxSubSteps
parameters.(NOTE: the example is rotated until PR #34 is merged and
Demo.js
is updated)This should close #16
This should close #36