Powah! (Rearchitected)

Powah! (Rearchitected)

3M Downloads

Lag from cables

Sunekaer opened this issue ยท 3 comments

commented
  • Minecraft: 1.18.2
  • Forge: 40.1.84
  • Powah: Powah-3.0.6.

Issue description:

_Hi, when we were playing in our dedicated server, we realized more than 50 to 60 any energy cables of Powah causes lag and after more than 60 cables, server starts to not respond and due to this, it gets crashed.

Also, due to this bug, when someone enters to those chunks which include those cables, server logs in console a huge not understandable text._

Steps to reproduce:

Try to put 50 to 60 of Powah energy cables. (this should lag server)
Put more cables (if you go to lobby or exit from game and come back to world, it loads chunks again and cause huge error log and not respond)

Player has confirmed removing all cables fixes the issue

Note someone think it could be related to this issue in the 1.16 version owmii/Powah#169

commented

Hi @Technici4n, it seems like when we place an energy cable, it checks every single cable again. As we can see in CableBlock.java#L182

Then it goes to CableBlock.java#L257 and then a huge amount of loop starts.

Also, after more than 50 cables are placed and connected to each other, when someone enters to that chunk (which means a chunk is triggered) it again searches all the cables and causes freezing server and timeout kicks.

I think cables could be cached more efficiently.

commented

Searching all cables when a cable is placed or loaded is fine, it's a very fast operation. Something else must be going on. (Searching 50 cables once for example is very fast, so I suspect something else is going on). Or maybe there's a loop in the search.

commented

FTBTeam/FTB-Modpack-Issues#1971 (comment)
Just bringing this comment here