ExoticGarden icon indicating copy to clipboard operation
ExoticGarden copied to clipboard

Performance Improvements

Open md5sha256 opened this issue 4 years ago • 2 comments
trafficstars

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

md5sha256 avatar Sep 10 '21 10:09 md5sha256

Stated comments in Discord but otherwise looks alright.

WalshyDev avatar Sep 10 '21 10:09 WalshyDev

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

md5sha256 avatar Sep 13 '21 14:09 md5sha256