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

Performance Improvements #215

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

Conversation

md5sha256
Copy link

@md5sha256 md5sha256 commented Sep 10, 2021

I haven't tested/benchmarked the changes of this PR on a live server just yet.

This PR adds non-breaking performance improvements in various places.

  • Pasting schematics should be faster, owing to fewer calls to Math.floorDiv and not needing to create a new Location object for each block being pasted.
  • Not doing physics updates when padting schematics
  • (More of a micro-optimisation here), List<Material> which only have contains calls have been replaced with EnumSet

@WalshyDev
Copy link
Contributor

Stated comments in Discord but otherwise looks alright.

@md5sha256 md5sha256 force-pushed the performance/general-improvements branch from 019c678 to 2270757 Compare September 10, 2021 14:08
@md5sha256
Copy link
Author

md5sha256 commented Sep 13, 2021

So basic benchmark:

3786 (omit because JIT?), 3233 (omit . . .), 1168, 1028, 1021 (10k schem pastes, with physics)

793, 766, 789, 1305, 807 (10k schem pastes without physics)

all units in ms. So roughly a 30% performance improvement

code used to test: here
the blocks were reset (/fill air) and entities killed (/kill @e[type=!player]) between runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants