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: Refactor Transform & AffineMatrix + related perf improvements #2346

Merged
merged 29 commits into from
Jun 13, 2022

Conversation

eonarheim
Copy link
Member

@eonarheim eonarheim commented Jun 11, 2022

===: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)

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

The PR refactors the Transform and AffineMatrix for performance & code simplicity reasons.

  • The AffineMatrix is a 2D matrix and performs less calculations then its counterpart
  • The Transform is move into a separate type and only calculates matrix/inverse when absolutely required reducing the cost of integration significatly

This PR also adds a few performance enhancements as well

  • Removes vector allocations in the integration loop
  • Inlines the ex.BoundingBox.transform to avoid vector allocations
  • Pre-allocate object pool space for draw calls

@eonarheim eonarheim changed the title perf: Refactor Transform & AffineMatrix perf: Refactor Transform & AffineMatrix + related perf improvements Jun 13, 2022
@eonarheim eonarheim merged commit 56da92e into main Jun 13, 2022
@eonarheim eonarheim deleted the perf/transform-matrix-refactor branch June 13, 2022 23:20
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.

1 participant