ironchest icon indicating copy to clipboard operation
ironchest copied to clipboard

1.12.2-7.0.59.842 | Hopper & Diamonds chests drops TPS

Open ghost opened this issue 5 years ago • 20 comments

So, Minecraft 1.12.2, latest Sponge API, latest 1.12.2 version of ur mod (1.12.2-7.0.59.842) and when players connect hopper to a diamond chest, there is big laggs (20.00TPS > 6.50 TPS).

I tried with only this mod and nothing more (no plugins etc) and the problem is still here. The server does not crash, but it's very very laggy.

Thank's in advance !

ghost avatar May 14 '19 20:05 ghost

Does this occur without sponge as well?

progwml6 avatar May 14 '19 21:05 progwml6

Mmmmh I think not, difficult to say but I tested that and I didn't had some laggs so I think nop.

ghost avatar May 14 '19 21:05 ghost

Edit: same with diamond shulker box :/

ghost avatar May 17 '19 19:05 ghost

And with golden chests too...

ghost avatar May 18 '19 20:05 ghost

Is this still happening with the latest release of IronChests?

alexbegt avatar May 29 '19 19:05 alexbegt

'will try it

ghost avatar May 31 '19 00:05 ghost

Seems fixed...

ghost avatar Jun 08 '19 21:06 ghost

Hi, I've met the same issue that the IronChest cost high cpu usage on my server. Upgrading IronChest from 1.12.2-7.0.59.842 to 1.12.2-7.0.67.844 won't fix the issue. It seems when the chest is full and using hopper to transmit block in it will cause the issue.

QQ20190618-230725@2x QQ20190618-230750@2x

9chu avatar Jun 18 '19 14:06 9chu

"Up" as we say

ghost avatar Jun 18 '19 19:06 ghost

"Up" as we say

Would you please tell me which one is the latest version? I have downloaded the version 1.12.2-7.0.67.844 from curseforge.com, which didn't work.

9chu avatar Jun 19 '19 01:06 9chu

same here boy, but as always no update

ghost avatar Jun 22 '19 23:06 ghost

RIP I think

ghost avatar Jul 02 '19 18:07 ghost

You might also want to consider the fact that the Iron Chests inventory handler copies every item stack being inserted into it. When there's a large number of capabilities/capability events, this can be quite painful. Considering the hopper in vanilla at least (I think) tries to insert into every slot, this means it's constantly copying itemstacks. I don't know if this is relevant but I just spotted this issue; I recently switched to a different mod after noticing while profiling (using YourKit) how dreadful the diamond chest's inventory handler was.

Specifically referring to this line in ICChestInventoryHandler.java. Honestly, I'm not sure what the design choice behind not switching to ItemStackHandler is at this point -- I presume this is just legacy code?

noobanidus avatar Jul 18 '19 23:07 noobanidus

Please try ironchest-1.12.2-7.0.71.846 when it goes live on curseforge to see if the TPS issue is fixed.

alexbegt avatar Jul 20 '19 02:07 alexbegt

Careful with the new version. Unless I misread that code, it now has major potential for voiding items.

HenryLoenwind avatar Jul 24 '19 10:07 HenryLoenwind

Yes, I agree with HenryLeonwind. I didn't realise the extent of modification as I was mainly focused on the overhead caused by the ItemStack copying. The entire item handler should be rewritten either to use ItemStackHandler as its base (instead of a pseudo-IInventory), or replaced with InvWrapper, or use InvWrapper as an example on how to perform operations on the pseudo-IInventory.

noobanidus avatar Jul 25 '19 06:07 noobanidus

May I just remark that the real root cause of this is that ItemStack.copy() has to fire that event instead of being able to clone the capabilities (like it does for item, meta and nbt). Intermediary cause is that some mod(s) subscribe to that event and waste CPU time. ItemStacks are copied thousands of time each tick, that has to be a fast operation.

HenryLoenwind avatar Jul 25 '19 07:07 HenryLoenwind

Oh, I agree, the issue is definitely some sort of cross-mod interaction with slow capability events. My point was more that none of the ~~vanilla~~ Forge implementations (ItemStackHandler, InvWrapper) copy straight off the bat, so they're less likely to suffer from the consequences of others' bad programming.

A further way of debugging this would definitely be to determine what mods add additional capabilities to ItemStacks in your pack and determine which ones are expensive and then pester those authors to update/improve their code.

noobanidus avatar Jul 25 '19 23:07 noobanidus

So RIP as we said.

ghost avatar Jul 26 '19 08:07 ghost

Try the newest version that I released on curseforge. It shouldn’t delete items as it uses vanillas

alexbegt avatar Jul 26 '19 13:07 alexbegt