CyclopsMC / IntegratedTunnels

Transfer other energy, items and fluids over Integrated Dynamics networks
MIT License
20 stars 13 forks source link

Massive lag with BotanyPots #285

Closed Wyrrrd closed 7 months ago

Wyrrrd commented 8 months ago

Issue type:


Short description:

Pumping out a hopper botany pot from BotanyPots with an item importer from the bottom adds massive lag to the server. Just 10 of those were enough to make my average setup unplayable.

(I am unsure if the error lies in this mod, since I am having no experience in modding. If not, kindly point me to the offender.)

Steps to reproduce the problem:

  1. Put an item importer pointing at the bottom of a hopper botany pot.
  2. Add plant and soil to the pot.
  3. Add a boolean "true" variable card to the importer.

Versions:

Profiler output:

Will add if needed.

rubensworks commented 8 months ago

Thanks for reporting!

rubensworks commented 8 months ago

Could you share a spark profiling log? That will allow us to identify where the source of the problem lies.

Wyrrrd commented 8 months ago

I could not recover the issue to its full extent (might have something to do with the amount of items in the botany pots), but it is still noticeable in the server console skipping ticks if connected to the main system.

rubensworks commented 8 months ago

@Wyrrrd Do you have a link at hand for this Spark profile? (usually people just share a link with me to a webpage)

Wyrrrd commented 8 months ago

I was unsure how long this link is valid and couldn't upload the file, but here you go: https://spark.lucko.me/9zHWQcRlcE

rubensworks commented 8 months ago

Thanks!

Until this is fixed, you may be able to disable passive interaction in the part settings of the item importer, since botany pots seem to try to push to the network on their own (which is the cause of the lag).

Note to self: a slotless item handler should be used here.

Screenshot 2024-01-23 at 20 04 52
Wyrrrd commented 8 months ago

I am fine, piping the hopper botany pot output through another inventory works, too.

Using the hopper pot in this constellation was laziness on my part to switch to the normal pot. (Which doesn't work as well, due to the normal pot having no output inventory slots.)

rubensworks commented 7 months ago

I just looked into this, and it's something I can not optimize unfortunately.

Botany pots make use of the slot-based item handler interface, which makes IT expose all slots in the network. Botany pots will therefore iterate across all slots in the network, which can produce lag for large network. But the ability to have access to all slots in the network is definitely desirable for many cases, so I'd prefer to keep it.

The only workaround is to disable passive interaction in the part settings of the item importer, or Botany pots could make use of the slotless item handler capability of common capabilities.