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

Optimize move_entities_globalstep_part1 #134

Conversation

Emojigit
Copy link
Contributor

@Emojigit Emojigit commented Aug 24, 2024

This PR optimizes move_entities_globalstep_part1 by reusing the same table and skipping the time-costly garbage collection. Other optimizations are also made, such as avoiding creating pointless vectors.

After some simple profiling, I found out that for key in table do table[key] = nil end is faster than garbage-collecting the old table.

This PR is ready for review.

Copy link
Member

@BuckarooBanzay BuckarooBanzay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@BuckarooBanzay BuckarooBanzay added the enhancement New feature or request label Aug 24, 2024
Copy link
Contributor

@wsor4035 wsor4035 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont really see the point to moving get_blockpos function, but 🤷. anyways looks good

@wsor4035 wsor4035 merged commit 171faec into mt-mods:master Aug 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants