MariaTheDinkus / Simply-Conveyors

Simply Conveyors is a mod in which you use conveyors to both move items around, and use them as player transport. It has multiple types of conveyors to fit your needs.
MIT License
6 stars 1 forks source link

Conveyors have really bad TPS (server performance issue) #41

Open Axylxys opened 6 years ago

Axylxys commented 6 years ago

So today i made a mob farm on our server, i thought using conveyors would be fun. Setup is nothing fancy: 3 rows of Modular intermediate conveyors in a straight line to carry mobs to a turret killing them. No fancy track or modules (only the last ones have a holding module), i turn the whole thing on and notice the server TPS went to the sky.

After checking with the LagGoggles mod and doing a profile, i noticed the conveyor belts are ticking like crazy even when nothing is on them. With the whole setup completely idle, the conveyors are doing 7% of the total tick time on the server. Each single one clocks at around 30-38μs. I laid down about a hundred of them so...

Needless to say, they're pretty much unusable for any kind of medium to large setup right now. Anything above 10 of them is gonna be a big hurdle on the server. A single conveyor belt doing nothing results in more tick time than most mod machines working, including some large multiblock structures, and they're up there with active entities like mobs or turrets who actively seek and shoot several targets.

Here is a screenshot of the profile. A the top, i added the global server tick for the conveyors, you can also see a sample on the list and how their TPS is close to a Laser Turret from Open Modular Turrets mods, and actually higher than a player (myself). I cut the list, but imagine about a hundred more conveyors like that below.

Using SimplyConveyors-4.0.4 on Minecraft 1.12 with Forge forge-1.12.2-14.23.2.2651-universal, on a server.

I hope this helps and the mod can be optimized (a lot). The conveyors are really fun, pretty and well done, but it's hard to justify using them on a multiplayer server with such a TPS cost. As a comparaison, Immersive Enginerring conveyors (also able to grab mobs and entities) clock at around 1μs when idle, Magneticraft ones (for items only) are below 10μs.

conveyors1

MariaTheDinkus commented 6 years ago

Due to the terrible code of the modular conveyors tileentity I highly recommend you only use them when you need to use one for a module. The other conveyors in comparison are highly efficiently made, and only tick when something is on the conveyor.

I’m working on a complete replacement for this mod named Logistical Automation which should get a release with some much improved conveyors quite soon. Modules will be entirely reworked at this point.

Really sorry you’re having these issues though. If I have some time this week I’ll gladly work on optimizing the modular conveyors for a final release of Simply Conveyors, as I already have ideas on how to do so.

Axylxys commented 6 years ago

Thanks for your answer :)

I didn't think the conveyor tier mattered for this, now i feel silly for not trying with the lower tier ones. I replaced my whole setup but i'll try again with the basic conveyors once i need another setup to move entities around.

Edit: I just made a quick test with all conveyor types side by side. Normal ones and intermediate don't even show up on LagGoggles, while the modular ones go up to 50μs. Seems like making only modular ones because they're pretty and i can afford them was a really stupid idea, lol.