GTNewHorizons / GT-New-Horizons-Modpack

New Modpack with Gregtech, Thaumcraft and Witchery
https://www.gtnewhorizons.com/
Other
968 stars 298 forks source link

Singleblock fluid heater export lag #15894

Open Logos-Askrson opened 6 months ago

Logos-Askrson commented 6 months ago

Your GTNH Discord Username

logos_askrson

Your Pack Version

2.5.1

Your Server

Eta

Java Version

Java 19

Type of Server

Thermos

Your Expectation

Trying to craft things with the singleblock fluid heater, I'd expect it to craft in a reasonable fashion without causing significant server impact.

The Reality

A LuV fluid heater crafting superglue causes ~2.2 ms of server impact. A ZPM fluid heater crafting superglue causes ~4.5ms of server impact.

Attempts to narrow the issue down indicate that the issue is attempting to use the fluid heater's innate fluid output to push into a dual interface. If exporting to some other storage (bedrockium drum tested), it works fine, but into a dual interface appears to cause unusually high amounts of lag.

Your Proposal

My best guess for the root cause is that it's exporting fluids into the dual interface in discrete packets, which are not combined, and are then individually routed for storage.

If this is the case, this might be addressed in a few different ways. A dual interface might combine packets of fluid that enter it, or cache the storage solution. Or the singleblock might have its export logic adjusted so it doesn't try to export every 2L of superglue individually when set to auto-export. Perhaps pushing once a second?

Final Checklist

NotAPenguin0 commented 5 months ago

Just tested this in-game, seems to indeed lag more than it should. I don't think limiting exports to once every few ticks will work well because it tends to break for certain setups (think for example someone using supercritical steam and expecting a certain amount of steam to enter turbines through a fluid p2p connection every tick).

Merging packets in a dual interface might be possible, I'm not too well versed with the AE2 codebase, so could get someone else to take a look, perhaps @kuba6000?