Mekanism

Mekanism

111M Downloads

Digital Miner Anchor Upgrade causes high server CPU load

TheSeven opened this issue ยท 2 comments

commented

It seems like the recently committed Anchor Upgrade for the Digital Miner causes a large increase in server CPU load.
Profiling shows >12ms per server tick (i.e. 25% of a CPU core) in mekanism.common.tile.component.TileComponentChunkLoader.tick(), most of which comes from calls to the forceChunks and release methods. This suggests that this code is re-requesting a chunkloading ticket for the miner every single server tick.
The reason for this isn't immediately obvious to me while looking at the code, it might possibly be related to the Digital Miner being in another dimension.

I didn't get get around to debugging this yet, but let me know if you need any further info.

commented

Would you mind providing a screenshot of the profiling, or a file I can open in VisualVM? I don't see how the release methods could be continuously called with my current implementation.

commented

Actually... I may be an idiot. This line of code:

if(chunkTicket != null && (!canOperate() || chunkTicket.world == tileEntity.getWorld()))

would seem to result in the ticket being released every tick. I fixed the boolean logic, things should be better now!