ExoticGarden
ExoticGarden copied to clipboard
Performance Improvements
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.floorDivand not needing to create a newLocationobject for each block being pasted. - Not doing physics updates when padting schematics
- (More of a micro-optimisation here),
List<Material>which only havecontainscalls have been replaced withEnumSet
Stated comments in Discord but otherwise looks alright.
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