Skip to content

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.

@selimanac
Copy link

I was planning to do something similar, but since this PR hasn’t been merged yet, there’s no point in duplicating the work.

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.

2 participants