Wolfieheart / ArmorStandEditor

Spigot/Paper etc. plugin to allow players to edit armorstands without commands.
GNU General Public License v3.0
28 stars 24 forks source link

[Bug]: Major TPS Lag with ArmorStandEditor plugin #594

Open DarkChromaMC opened 5 days ago

DarkChromaMC commented 5 days ago

Expected behavior

Smooth container interactions without TPS lag, even with many shulker boxes.

Observed/Actual behavior

Heavy TPS lag occurs when opening or closing a container with multiple shulker boxes.

Steps/models to reproduce

chest.schem.zip hotbar.nbt.zip

Plugin list

ArmorStandEditor 1.21-47

Plugin Version

1.21-47

Server Version

Purpur 1.21.1 (latest - build 2315)

Other

Enabling ArmorStandEditor causes significant TPS drops when players open or close containers holding lots of shulker boxes. Without the plugin, performance remains fully stable under the same conditions.

Please address this issue to ensure optimal server performance. Let me know if more information is needed. Thank you!

Video provided to demonstrate: https://youtu.be/VhPIgemfSso

Spark profile: https://spark.lucko.me/tlGZaWamK5

Wolfieheart commented 3 days ago

Looking at the code in question and the 2 TPS threads for ArmorStandEditor....

I dont see how ASE could cause the TPS drop immediately (might be cause it is 8AM CEST on 3/10 and im still waking up), as the code in question runs as follows: https://github.com/Wolfieheart/ArmorStandEditor/blob/2b36e88c7d685f3f4ce65e7ac67325386a813314/src/main/java/io/github/rypofalem/armorstandeditor/PlayerEditorManager.java#L401-L446

Unless there it is not liking the entity.getInventory.GetHolder(); which runs from PlayerEditorManager to the specific menus which themselves are new instances of https://github.com/Wolfieheart/ArmorStandEditor/blob/master/src/main/java/io/github/rypofalem/armorstandeditor/menu/ASEHolder.java

Plus a question or two: