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: Remove allocations from image-renderer #2962

Merged
merged 15 commits into from
Mar 30, 2024

Conversation

eonarheim
Copy link
Member

@eonarheim eonarheim commented Mar 12, 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)

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

See excalibur bunnymark https://github.com/excaliburjs/excalibur-bunnymark

This PR removes allocations and makes several perf improvements that DOUBLES our performance on the bunnymark

  • Removes all allocations from the draw image hot path
  • Removes allocations from object pool
  • Removes unecessary getters
  • Speed up AffineMatrix clone
  • Switches webgl to VAOs
  • Speed up texture id lookup
  • Caches native thunks to width/height

New Perf Results

~50fps @ 20,000 sprites.

image

~30fps @ 35000 sprites

image

Previous Perf Results on Excalibur main

~25fps @ 20000 sprites

image

~15fps @ 35000 sprites
image

Copy link

cloudflare-workers-and-pages bot commented Mar 12, 2024

Deploying excaliburjs with  Cloudflare Pages  Cloudflare Pages

Latest commit: be731c2
Status: ✅  Deploy successful!
Preview URL: https://9159d9a6.excaliburjs.pages.dev
Branch Preview URL: https://perf-zero-allocation-image-r.excaliburjs.pages.dev

View logs

@eonarheim eonarheim merged commit 3f3ac09 into main Mar 30, 2024
6 of 7 checks passed
@eonarheim eonarheim deleted the perf/zero-allocation-image-renderer branch March 30, 2024 04:39
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