Favouriteless / Enchanted

Enchanted minecraft mod repository
6 stars 5 forks source link

Distillery TileEntity causes extreme and persistent TPS lag on dedicated servers #13

Closed PrimalMew closed 4 months ago

PrimalMew commented 1 year ago

Describe the bug In the latest version 1.0.3 of Enchanted on MC 1.18.2 placing the Distillery block down in the world immediately causes significant TPS lag spikes on dedicated servers. When the block is placed it immediately causes a lag spike at that time of 10,000ms (400 ticks) behind and then also results in drops in TPS for the server when it runs the save function for the world while the chunks the block is in are rendered. This causes persistent lag if the block is placed down, as the world is constantly saving.

It is important to note that this is occurring in a mod pack with over 150 other mods present. Though it stands out as the only persistent cause of issues. That being the case though there is the lingering idea that this could be caused by an incompatibility with other mods. With that in mind I have inspected the area of the block and the only other mods present in the area are Refined Storage, Mystical Agriculture, Ars Nouveau, SecurityCraft, Quark, Create, Mekanism, and Tinker's Construct. I have not tested what occurs with just the Enchanted mod only.

Included in the screenshots section is a screenshot of Spark profiler results in relation to these TPS drops for Enchanted specifically. This significantly impacts performance. The only thing that has been able to stop it is having players break the block and avoid placing it down or to not have it rendered.

Unfortunately I do not really have any logs for this, as it has never caused the server to crash. If you need additional information though just let me know what is needed and I will see if I can get it.

To Reproduce Place the distillery block down in the world

Expected behavior Does not lag server TPS when the distillery is placed down

Screenshots Screenshot_2

Favouriteless commented 1 year ago

Will take a look asap. Can you confirm that other recipe blocks like the spinning wheel and witch oven do not cause the same behaviour? They use very similar recipe matching methods which seems to be where the ticks are hanging.

I'm also unable to replicate this myself, so please send the modpack if you can.

Favouriteless commented 1 year ago

Just removed a likely culprit but will keep this issue open until it's confirmed to not be causing problems any more. Will try to put out a hotfix for this tomorrow alongside some other changes I'm working on.

PrimalMew commented 1 year ago

I can confirm that it is still persisting in the latest 1.0.4 version. I am not sure if this was displaying before but the console does show an error in the log when the block is placed down. It also shows an error in the console after right-clicking and opening the menu for the distillery. I do see some references to KubeJS in the error, so that could be conflicting somehow. KubeJS does manage recipes...though it is not used to modify any Enchanted recipes for this modpack.

Here is the error that shows in logs when the block is placed: https://pastebin.com/WfGsjsnP

Here is the error for when the block menu is opened (May actually just be the same error): https://pastebin.com/qdV5KA9X

Also, here is the mod pack that is being used if that helps. It is a custom mod pack so I cannot link it, you would just import this into CurseForge. MagiCraft Modpack - Forge-1.0.4.zip