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

Reduce allocations on update #66

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

redoak
Copy link
Contributor

@redoak redoak commented Feb 7, 2024

I've removed unnecessary allocations in the render_script and camera module update functions. I've also re-ordered a couple of things and added a few locals for readability and convenience.

In camera's update this results in a ~22% reduction. Unfortunately, the garbage produced by the many calls to go.get is quite significant, ~5000B, so the reduction of vmath garbage by ~1500B doesn't look so great in comparison.

The code is arguably a bit less readable and elegant; feel free to reject some or all of these changes.

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.

None yet

1 participant