Ad Astra: Giselle Addon

Ad Astra: Giselle Addon

15M Downloads

Performance Optimizations

pitbox46 opened this issue ยท 3 comments

commented

The details

Forge 1.20.1, ATM9

This mod adds quite a bit of overhead without even using it's features. The biggest issue is checking and attempting to distribute oxygen (OxygenChargerUtils#distributeToItems()) for every entity of every tick. I will be changing the logic so it runs only once every 20 ticks and distributes 20 times as much (so I can quickly deploy a fix for a server).
However, this is only a bandage since it looks like in streamExtractable() that this implementation would leave some oxygen left over in the tanks. I'm trying to think through it, but I think it would require some code reorganization to make it work nicely.

Also ProofAbstractUtils seems to be using a non-insignificant amount of time as well. This seems to be due to the use of CompoundTags. It looks like tags aren't a very efficient way to store commonly accessed data.

image

commented

If you would like I have the commit I made here. It's very basic, but it cuts the tick times down to 5% of what it was

1.20.1-rework...pitbox46:Ad-Astra-Giselle-Addon:1.20.1-rework

commented

Looks good, i will patch thier soon.

commented

ok, i added checking delay condition for oxygen distribution.
to modify config, can reduce cpu overhead more.

and i agree what you said nbt is not efficient.
there too many allocations and calls to just save integers.
so, i fixed to used nbt at load/save entity data only.