Skip to content

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