Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Bad performance #21

Open
andreasdc opened this issue Oct 28, 2021 · 2 comments
Open

Bad performance #21

andreasdc opened this issue Oct 28, 2021 · 2 comments

Comments

@andreasdc
Copy link

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

@Samsuik
Copy link
Owner

Samsuik commented Oct 31, 2021

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.

@andreasdc
Copy link
Author

andreasdc commented Oct 31, 2021

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. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants