[1.12.2] Thermoelectric gens performance review requested - taking too many ticks.
ProsperCraft opened this issue ยท 6 comments
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
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?
oddly, it seemed that the server had to be rebooted to recover the performance.
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...
@BluSunrize
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 #2929 (comment).