Nukepowered / GregTech4

A port of GregTech 4 to Minecraft 1.7.10 with optimization on most processes, fixed networking and rendering.
GNU General Public License v3.0
29 stars 17 forks source link

Large Turbine Generators Causing lag #188

Closed lyeochan closed 11 months ago

lyeochan commented 1 year ago

I have a server running with GT4, and since we reached turbines (kinda expected considering my previous posts), there was a massive increase in lag. The Console Show messages like thse.

Server thread/WARN [GregTech]: WARNING: Possible Lag Source at [74, 74, 644] in Dimension 0 with 347ms caused by an instance of class gregtechmod.common.tileentities.energy.production.multi.GT_MetaTileEntity_Multi_GasTurbine

lyeochan commented 1 year ago

using laggogles i get this result 2023-04-20_00 38 12

lyeochan commented 1 year ago

i was reading the code, and tested some values.

on line 161 of AbstractTurbine.java

public void startProcess() {
    if (GT_Items.Component_Turbine_Bronze.isStackEqual(mInventory[1], true, true)) {
        mEfficiencyIncrease = 10;
    } else if (GT_Items.Component_Turbine_Steel.isStackEqual(mInventory[1], true, true)) {
        mEfficiencyIncrease = 20;
    } else if (GT_Items.Component_Turbine_Magnalium.isStackEqual(mInventory[1], true, true)) {
        mEfficiencyIncrease = 50;
    } else if (GT_Items.Component_Turbine_TungstenSteel.isStackEqual(mInventory[1], true, true)) {
        mEfficiencyIncrease = 15;
    } else if (GT_Items.Component_Turbine_Carbon.isStackEqual(mInventory[1], true, true)) {
        mEfficiencyIncrease = 100;
    } else {
        mEfficiencyIncrease = 20;
    }
}

running different rotors types changes how much lag the generator makes. With a Carbon Rotor I was getting values of up to 690uS/t, while running a bronze rotor I would only get 195,

I imagine this is cause the bronze rotor passes the check instantly, whereas for the other ones they need progressively more tests.

TheDarkDnKTv commented 11 months ago

Message from console showing much higer lag comparing that your gogles are showing. I will check code, seems like some processing adding real stutter. Since 375ms is literaly 7.5tps stolen in that second