Create Fabric

Create Fabric

7M Downloads

Chute is extremely laggy when downward storage is full

aria1th opened this issue · 5 comments

commented

Describe the Bug

2022-03-08_22 43 56

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

  1. Place chute in world
  2. Place chest below chutes
  3. Fulfill items in chests
  4. 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

2022-03-08_22 54 52

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...

commented

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.

commented

I fixed chute lag partially but now I recognized funnel is laggy too, actually ItemHelper class is just bunch of lag....

commented

Can you profile the latest build? It should help somewhat.

commented

https://github.com/Fabricators-of-Create/Create/actions/runs/1960988251 (build 458)
I used this, and verified its not changed 😢
2022-03-10_19 47 40

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...

commented

Please test this on build 482 or newer. If this issue still occurs, please re-open it.