Chute is extremely laggy when downward storage is full
aria1th opened this issue · 5 comments
Describe the Bug
Single chute entity can produce 4mspt(for 27 slots, it can go up and up) when downward storage is full.
https://spark.lucko.me/TWSShF9QGq
This is profiler link. Its produced from 5 chutes facing down with shape NORMAL, heading to Double chests.
Shute should use insert() method when its available, if downward position is SidedStorage. It should never iterate over slots to push items.
Lag is directly related to downward storage's size itself because it uses iteration.
Reproduction Steps
- Place chute in world
- Place chest below chutes
- Fulfill items in chests
- Profile.
...
Expected Result
Chute should be less or equally laggy as hopper.
At least it should cache slots or use Fabric Transfer API, or allow caching Storage itself and use it.
Compared result to https://spark.lucko.me/I4RtvzdMvR
When mini chests (Single Stack Storage) is used, its 27x less laggier, which proves the lag comes from iteration itself.
Its transfer method is very wrong for general storages too.
Screenshots and Videos
Crash Report or Log
https://spark.lucko.me/TWSShF9QGq
Operating System
Windows 10
Mod Version
0.4.0d
Minecraft Version
1.18.1
Other Mods
No response
Additional Context
please god what is that code...
The mess of transfer is a result of maintaining upstream code compat. the bridge between forge and fabric transfer is about as stable as a house of cards. Rewriting to use fabric transfer directly has been on the “maybe one day” list but I think it’s inevitable.
I fixed chute lag partially but now I recognized funnel is laggy too, actually ItemHelper class is just bunch of lag....
https://github.com/Fabricators-of-Create/Create/actions/runs/1960988251 (build 458)
I used this, and verified its not changed 😢
Also for details, its not laggy when you use full vaults. it only costs 0.03mspt even if vault is full and large.
I should note that funnels have exactly same problem (well, not exactly but its same context). They are extremely laggy when they can't output / input when there's no area.
Here's profiler result for chutes
https://spark.lucko.me/ZZU1m6iSi4
it used latest porting lib right? sadly seems there's no notable difference...
Please test this on build 482 or newer. If this issue still occurs, please re-open it.