Terminal (lack of) performance with big network and a lot of updates
Hiranus opened this issue ยท 4 comments
Issue type:
- ๐ Performance issue
Short description:
As you see I have lots of items in network. 24 double golden chests from Sophisticated Storage and drawer network from Functional Storage.
When I start autocrafting via Integrated Terminal or I turn on something that pushes items into the network every few ticks, like a very fast smelter or processing of combs from Productive Bees then terminal either barely functions or freezes (to the point that windows shows "java is not responding" window) and I have to wait until server finishes doing whatever it's currently working on and only then I regain control.
Steps to reproduce the problem:
My best guess is to have really large network and then simulate its heavy use. For example, you could setup something that pulls large amount of items into the network and then something that exports these items from the network which would result in huge amount of "items added" and "items removed" updates.
I think that terminal simply struggles with the amount of updates that are generated. Basic solution would be to check how fast updates are generated and if it's too fast then group them and send one bigger update every 2 seconds or so rather than 10 updates every tick.
Versions:
- This mod: 1,6,4
- IntegratedDynamics: 1.23.16
- CyclopsCore: 1.25.2-634
- Minecraft: 1,21
- Forge: NeoForge 21,1,74
Profiler output:
This is from me crafting 30 diamond drawer upgrades from Functional Storage. Client froze and I had to wait until crafting was finished.
https://spark.lucko.me/1hgtK9XeTB
This profile is from when I queued 2000 combs to be processed and opened terminal, UI didnt froze, but I had huge lag spikes. Processing of these combs pushed something into the network every ~4 ticks or less, depending on the comb.
https://spark.lucko.me/k2Z1Ktcnnp
Note to self:
May be related to CyclopsMC/IntegratedDynamics#1412
https://github.com/CyclopsMC/IntegratedTerminals/blob/master-1.21/src/main/java/org/cyclops/integratedterminals/core/terminalstorage/TerminalStorageTabIngredientComponentClient.java#L407 (why is the diff calc even needed?) (somehow optimize, or move to a different thread)
Thanks for taking the time to report this @Hiranus. I have a very similar setup with sophisticated storage and functional drawers and any time I craft a big item (Omega beehive upgrade) my client just hangs until it's done. I've been meaning try and setup a test world that exhibited it but just haven't gotten to it.
I agree that this really needs to be investigated and resolved which would solidify this mod in the crafting area. Right now I used it as a stepping stone to get to max AE2 Quantum/Matrix crafting.