Modular Machinery

Modular Machinery

12M Downloads

TileEnergyOutputHatch appears to cause lag looking for a Draconic Evolution core

jorupp opened this issue ยท 2 comments

commented

Modular Machinery Version: 1.10.0
Draconic Evolution: 1.12.2-2.3.22.343 (2.3.22)
Modpack: Omnifactory 1.2.1

Spark profiler: https://sparkprofiler.github.io/#NkAHJA0YAz
Screenshot of notable part of above: https://i.imgur.com/sKOJfZp.png
Lag Goggles shows ~4ms/t spent updating the energy output hatch.

From lining the profiler info up with https://github.com/HellFirePvP/ModularMachinery/blob/master/src/main/java/hellfirepvp/modularmachinery/common/tiles/TileEnergyOutputHatch.java, it looks like the issue is searching for the Draconic Evolution Energy Core in a 16-block radius every 100 ticks.

Assuming that's what it is and there's really no more efficient way to find the DE Energy Core, I'm wondering if one or more of these options would be viable:

  1. Add a configuration option to disable outputting to a DE Energy Core (and scanning for it), even if DE is loaded.
  2. Only scan for the DE core when there is power available to transfer.
  3. Only scan for the DE core when there was no GT/RF target available to transfer to.
  4. Handle DE core after GT/RF targets and only if there's power left over to transfer.
  5. Make scan interval for the DE core configurable (currently set to 100 ticks).
  6. Make scan range for the DE core configuration (currently set to 16 blocks).
  7. Use a different block for outputting to DE Energy Core so the GT/RF block doesn't need to scan for a possibly-non-existent core.
commented

This was fixed in MM 1.11.1.

commented

Ah, I should have looked at the history of that file. It looks like it used to search every tick and with a radius of 24, so searching every 100 ticks and at a range of 16 should lower it's impact by a factor of ~300x.