VolmitSoftware / Iris

World Generation through a new Iris
https://volmit.com
GNU General Public License v3.0
443 stars 165 forks source link

Improve performance of wand selection rendering #1121

Closed SirYwell closed 1 week ago

SirYwell commented 1 week ago

We've had multiple people in the FAWE help channels wondering why their servers stop responding in the last weeks. It always came down to the Iris wand selection utility taking up too much time per tick. The bukkit scheduler doesn't care about that and just starts more threads each tick then. Over time, this results in thread starvation of other threads, as well as significantly higher memory pressure.

Most of this comes down to the time complexity of how the particle rendering works. Instead of looking at each block in the cuboid, we can simply only look at the blocks at edges. Additionally, we can filter out edges that are too far away from the player anyway.

A theoretical additional improvement would be reducing the edge length to what the player actually sees directly before iterating, but from my testing, this improvement is already enough.

CrazyDev05 commented 1 week ago

already done in #1115