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 improvements avoid expensive calculations #2197

Merged
merged 6 commits into from
Jan 18, 2022

Conversation

eonarheim
Copy link
Member

@eonarheim eonarheim commented Jan 15, 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)

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

This PR adds some small performance enhancements to avoid recalculation if unneeded, gives decent performance boost. Smooths out the FPS a bit

Before improvements:
image

After improvements:
image

Related to road map graphics performance improvements #1161

Changes:

  • Calculate sprite dimensions only if needed
  • Calculate graphics transform only if needed
  • Update text only if needed

@github-actions github-actions bot added the bug This issue describes undesirable, incorrect, or unexpected behavior label Jan 15, 2022
@eonarheim eonarheim merged commit a1c64bd into main Jan 18, 2022
@eonarheim eonarheim deleted the fix/graphics-predraw branch January 18, 2022 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant