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

perf: Improve narrowphase and realistic solver performance #3114

Merged
merged 29 commits into from
Jun 30, 2024

Conversation

eonarheim
Copy link
Member

@eonarheim eonarheim commented Jun 30, 2024

===:clipboard: PR Checklist :clipboard:===

  • 📌 issue exists in github for these changes
  • 🔬 existing tests still pass
  • 🙈 code conforms to the style guide
  • 📐 new tests written and passing / old tests updated with new scenario(s)
  • 📄 changelog entry added (or not needed)

==================

Closes #3006 thanks @ikudrickiy!

This PR implements a lot of low hanging fruit optimizations to the narrowphase and realistic solver.

Notably:

  • Working in the local polygon space as much as possible speeds things up
  • Add another pair filtering condition on the SparseHashGridCollisionProcessor which reduces pairs passed to narrowphase
  • Switching to c-style loops where possible
  • Caching component calls
  • Removing allocations where it makes sense
  • Optimize Side.fromDirection(direction: Vector): Side - thanks @ikudrickiy!

Also this fixes a bug in the new physics config merging, and re-arranged to better match the existing pattern

Copy link

cloudflare-workers-and-pages bot commented Jun 30, 2024

Deploying excaliburjs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 970aa48
Status: ✅  Deploy successful!
Preview URL: https://f86b30d0.excaliburjs.pages.dev
Branch Preview URL: https://perf-narrowphase.excaliburjs.pages.dev

View logs

@eonarheim eonarheim merged commit fcec226 into main Jun 30, 2024
7 of 8 checks passed
@eonarheim eonarheim deleted the perf/narrowphase branch June 30, 2024 22:13
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.

Optimise Side.fromDirection(direction: Vector): Side
2 participants