Storage Drawers: Forestry Pack

Storage Drawers: Forestry Pack

6M Downloads

TPS Lag when coupled with AE2

nrllewellyn opened this issue ยท 5 comments

commented

I have found that Storage Drawers causes extreme TPS lag when coupled with the AE2 storage bus and AE2 autocrafting. My setup includes:

  • A large set of drawers with a drawer controller
  • An AE2 system set up to with a storage bus on the drawer controller
  • An AE2 autocrafting system
  • An AE2 export bus with the crafting card attempting to export a crafted item to another inventory

When I profile the running application, 46.8% of the server thread's time is being spent in these two methods:
com.jaquadro.minecraft.storagedrawers.inventory.DrawerItemHandler.extractItem() 33.696033 60,314 ms (33.7%) 60,314 ms
( Most of the time in this method is being used here: com.jaquadro.minecraft.storagedrawers.storage.BaseDrawerData.getStoredItemCopy() 22.505943 40,284 ms (22.5%) 40,284 ms)
com.jaquadro.minecraft.storagedrawers.inventory.DrawerItemHandler.getStackInSlot() 10.388455 18,594 ms (10.4%) 18,594 ms

Not sure if this is something that can be resolved, or is just a limitation of mixing the two mods, but I thought you might want to know!

Relevant versions:

  • Minecraft: 1.10.2
  • Forge: 12.18.3.2239
  • Applied Energistics: rv4-alpha-11
  • Storage Drawers: 3.6.0
commented

@jaquadro The thing is, RS doesn't lag at all. That means that AE2 does something different that causes those TPS lags.

commented

It is what it is, pretty much. It's a combination of AE2 polling frequently and making its own copies of item stacks, when dealing with item stacks in the first place is pretty expensive. But it's necessary so there's not much to do.

It's possible AE2 could get some benefit from using the updated API like RS does on 1.12+, but it probably won't happen, and I don't know how much the benefit would be.

commented

Any update about this issue ? I got same issue on my server :

[02:49:43] [LagSpikeProfiler/INFO] [TickProfiler]: The server appears to have lag spiked. Last tick 0.20731904s ago."Server thread" RUNNABLE at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185) at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:565) at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:555) at net.minecraft.item.ItemStack.func_150996_a(ItemStack.java:948) at net.minecraft.item.ItemStack.<init>(ItemStack.java:96) at net.minecraft.item.ItemStack.func_77946_l(ItemStack.java:357) at com.jaquadro.minecraft.storagedrawers.storage.BaseDrawerData.getStoredItemCopy(BaseDrawerData.java:36) at com.jaquadro.minecraft.storagedrawers.inventory.DrawerItemHandler.extractItem(DrawerItemHandler.java:151) at appeng.parts.misc.ItemHandlerAdapter.extractItems(ItemHandlerAdapter.java:127) at appeng.parts.misc.ItemHandlerAdapter.extractItems(ItemHandlerAdapter.java:50) at appeng.me.storage.MEPassThrough.extractItems(MEPassThrough.java:63) at appeng.me.storage.MEInventoryHandler.extractItems(MEInventoryHandler.java:117) at appeng.me.storage.NetworkInventoryHandler.extractItems(NetworkInventoryHandler.java:229) at appeng.me.cache.NetworkMonitor.extractItems(NetworkMonitor.java:93) at appeng.crafting.MECraftingInventory.<init>(MECraftingInventory.java:139) at appeng.crafting.CraftingJob.<init>(CraftingJob.java:90) at appeng.me.cache.CraftingGridCache.beginCraftingJob(CraftingGridCache.java:505) at appeng.helpers.MultiCraftingTracker.handleCrafting(MultiCraftingTracker.java:135) at appeng.helpers.DualityInterface.handleCrafting(DualityInterface.java:770) at appeng.helpers.DualityInterface.usePlan(DualityInterface.java:703) at appeng.helpers.DualityInterface.updateStorage(DualityInterface.java:660) at appeng.helpers.DualityInterface.tickingRequest(DualityInterface.java:592) at appeng.tile.misc.TileInterface.tickingRequest(TileInterface.java:236) at appeng.me.cache.TickManagerCache.onUpdateTick(TickManagerCache.java:92) at appeng.me.GridCacheWrapper.onUpdateTick(GridCacheWrapper.java:43) at appeng.me.Grid.update(Grid.java:280) at appeng.hooks.TickHandler.onTick(TickHandler.java:236) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_719_TickHandler_onTick_TickEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185) at net.minecraftforge.fml.common.FMLCommonHandler.onPostServerTick(FMLCommonHandler.java:261) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:657) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471) at java.lang.Thread.run(Thread.java:745)

commented

rs lags!

@sirwindfield
This is an rs controller in 1.12.2 in the off state using redstone signal lagging at 1153 ms/t
image

since this is open, would like to point out this is a drawcontroller connected to a refined storage system that is lagging hard.
image

commented

removed the rs connection and tick went to 0
image