The AdvancedPortals plugin is causing significant server lag due to the com.sekwah.advancedportals.bukkit.listeners.PortalPlacer.onChunkLoad() method being called every time a chunk loads. This issue is particularly noticeable when new chunks are being generated. In our server setup, the portal block is only used once for creating portals at Spawn and is never used again, making the frequent calls to this method unnecessary and performance-heavy.
Steps to Reproduce:
Install the AdvancedPortals plugin on a Minecraft server.
Ensure the server has areas where new chunks are frequently generated (e.g., exploring new areas).
Monitor server performance and observe the high CPU usage and lag spikes correlated with chunk loads.
Expected Behavior:
The PortalPlacer.onChunkLoad() method should not cause significant lag, especially when the portal block is infrequently used.
Observed Behavior:
Low TPS is observed when chunks are loaded, due to the PortalPlacer.onChunkLoad() method being called excessively.
Impact:
This issue severely impacts server performance, making it difficult to provide a smooth gameplay experience, especially in areas with high rates of chunk generation like players flying with an elytra.
Environment:
Minecraft Version: 1.21
AdvancedPortals Version: Latest 1.0.0
Proposed Solutions:
Introduce a setting in the plugin's configuration file to disable the onChunkLoad listener for servers that do not need it.
Optimize the onChunkLoad method to reduce its performance impact. This could include caching results or reducing the frequency of operations performed during chunk load events.
Implement a conditional check to ensure the onChunkLoad method only processes chunks if they contain relevant portal blocks, avoiding unnecessary processing for chunks without portals.
Additional Context:
Our server primarily uses portal blocks at Spawn for initial setup, and they are rarely used elsewhere. Therefore, the frequent calls to onChunkLoad are unnecessary in our context and degrade server performance.
Thank you for your attention to this issue. Optimizing or providing a way to disable this feature would greatly enhance server performance and player experience.
I have plans to optimise it as paper has a value you can pass to it but spigots implementation is super inefficient. Though adding a value to toggle it would be good.
The
AdvancedPortals
plugin is causing significant server lag due to thecom.sekwah.advancedportals.bukkit.listeners.PortalPlacer.onChunkLoad()
method being called every time a chunk loads. This issue is particularly noticeable when new chunks are being generated. In our server setup, the portal block is only used once for creating portals at Spawn and is never used again, making the frequent calls to this method unnecessary and performance-heavy.Steps to Reproduce:
Expected Behavior: The
PortalPlacer.onChunkLoad()
method should not cause significant lag, especially when the portal block is infrequently used.Observed Behavior: Low TPS is observed when chunks are loaded, due to the
PortalPlacer.onChunkLoad()
method being called excessively.Impact: This issue severely impacts server performance, making it difficult to provide a smooth gameplay experience, especially in areas with high rates of chunk generation like players flying with an elytra.
Environment:
Proposed Solutions:
onChunkLoad
listener for servers that do not need it.onChunkLoad
method to reduce its performance impact. This could include caching results or reducing the frequency of operations performed during chunk load events.onChunkLoad
method only processes chunks if they contain relevant portal blocks, avoiding unnecessary processing for chunks without portals.Additional Context: Our server primarily uses portal blocks at Spawn for initial setup, and they are rarely used elsewhere. Therefore, the frequent calls to
onChunkLoad
are unnecessary in our context and degrade server performance.Attachments: https://spark.lucko.me/6rbL5fAZds?hl=752
Thank you for your attention to this issue. Optimizing or providing a way to disable this feature would greatly enhance server performance and player experience.