Open andreasdc opened 2 years ago
It caps the amount of entities getEntities
can collect per section. For 1000 entities within a block with the original implementation it would add all 1000 entities to the list, only for the amount specified in the spigot config to actually be used. This would skip a lot of unnecessary calculations and list resizing when entities are packed together. The significant performance regression you're experiencing is likely due to the bad implementation of what I had in mind.
It caps the amount of entities
getEntities
can collect per section. For 1000 entities within a block with the original implementation it would add all 1000 entities to the list, only for the amount specified in the spigot config to actually be used. This would skip a lot of unnecessary calculations and list resizing when entities are packed together. The significant performance regression you're experiencing is likely due to the bad implementation of what I had in mind.
Yes, but even without it original code is faster. I added limit to original code and it's way faster.
Ok, I understand. :)
In what scenario is this better? In my tests this is worse about 70% than original code. https://github.com/SuicidalKids/IonSpigot/blob/master/TacoSpigot-Server-Patches/0035-Optimise-Entity-Collisions.patch