BluSunrize / ImmersiveEngineering

Wires, transformers, high voltage! Bzzzzt!
Other
788 stars 393 forks source link

[1.12.2] Thermoelectric gens performance review requested - taking too many ticks. #2930

Closed ProsperCraft closed 6 years ago

ProsperCraft commented 6 years ago

Description of the issue:

Thermoelectric gens were taking 70% of our entire server tick, after removing 50 or so, they are still taking too much of the performance.

Versions & Modlist

Modlist here - https://minecraft.curseforge.com/projects/towncraft

Find attached sampler file for viewing in visualvm Thermoelectricgens.zip

Find attached warmroast- thermoelectric.zip

Lagoggles- 2018-04-08_10 35 40 2018-04-08_10 35 30

BluSunrize commented 6 years ago

Did you notice an improvement in performance as you were removing them? Asking out of interest.

@malte0811 easiest way to fix this would probably have them check their temperature gradients on block update, right? Only check them when the world around changes? Sound sensible?

ProsperCraft commented 6 years ago

oddly, it seemed that the server had to be rebooted to recover the performance.

BluSunrize commented 6 years ago

That seems to at least give a bit of premise to the idea that it's not IE's thermoelectrics that are causing your performance issues...

malte0811 commented 6 years ago

@BluSunrize visualvm Checking on block updates would fix this, the root cause is quite interesting though: About 90% of the time taken by the thermoelectrics are spent creating 2 itemstacks (due to capability initialization events). We can probably work around some of it (the call to copyStackWithAmount can probably be removed in some way), but this is mostly a forge problem, made worse by "timings" using 2 event handlers for capability initialization. Also, you still haven't replied to the second paragraph of https://github.com/BluSunrize/ImmersiveEngineering/issues/2929#issuecomment-379487691.

BluSunrize commented 6 years ago

I told you yesterday that I deleted my comment because I didn't know either.

LemADEC commented 6 years ago

Where do we stand on fixing this lag source? image That's on FTB Revelation 1.8.0 including ImmersiveEngineering-0.12-80.jar