Ender IO Zoo

Ender IO Zoo

962k Downloads

Speed Upgrades - Incoming items dramatically change item conduit / speed upgrade rate

tofof opened this issue ยท 2 comments

commented

Issue Description:

Reported to modpack at https://support.feed-the-beast.com/t/skyfactory-3-enderio-item-conduit-speed-upgrades-dont-stack-past-5/32346 but further testing shows this is isolated to EnderIO.

When incoming items arrive quickly enough, EnderIO item conduits with speed upgrades transfer only the partial stack of new arrivals, dramatically slowing down the transfer rate.

What happens:

For an example, I use Tiny Progressions 1.1.0 cobblestone generators to fill a chest that an EnderIO item conduit extracts from. The 'gold' version of the generator produces 1 cobblestone every 5 ticks. The 'emerald' version produces 1 cobblestone on every tick. The generator empties into inventories above it, so it is placed below a vanilla chest. The chest has an item conduit attached in extract mode, which attaches immediately in insert mode to a second chest.

Time to move 18 stacks (2 full rows) of 64 cobble:

0 speed upgrades: 135s
0 + gold (every 5 ticks): 135s
0 + emerald (every tick): 135s

With 0 speed upgrades, everything acts as expected. The presence or absence of the generator has no effect on transfer speed.

5 speed upgrades: 25s
5 + gold (every 5 ticks): 30s
5 + emerald (every tick): 60s

With 5 speed upgrades we see a significant difference in the transfer speeds. In particular, the emerald/every-tick generator seems to cause EnderIO to only grab the single piece of cobble generated since the previous tick, transferring it and only it. As a result, it takes approximately 60 seconds to transfer all the items. This is the duration we would expected by the math of moving only 1 item per tick, i.e. 18*64 items / 1 item/tick / 20 ticks/second = 57.6 seconds.

15 speed upgrades: 9s
15 + diamond (every 10 ticks): 10s
15 + gold (every 5 ticks): 10s
15 + emerald (every tick): 60s

With 15 speed upgrades the same effect is happening, and so with an emerald/every-tick gen filling the source chest, it takes just as long to transfer as it did at only 5 speed upgrades - approximately 60 seconds. The diamond and gold produce very little of an effect, but do exhibit some of the same behavior - EnderIO grabs a 1-cobble (or 2-cobble) sized stack only once instead of every single time, and so does 19 moves instead of the 18 that happen without the generator present.

Note:
With 1-4 speed upgrades the problem will happen, but only after a delay - more stacks transfer 'normally' before the problem is observable the fewer speed upgrades are present. With just one or two upgrades, several stacks (4-8) transfer normally first. With 5 though, we will see it happen midway through the 2nd stack.

What you expected to happen:

Adding items to a chest should not cause a dramatic slowdown in the extraction rate.

Steps to reproduce:

  1. Fill a source chest such that items are arriving once every tick. (Perhaps every 2 ticks will produce the bug also, but as showed above every 5 ticks or slower will hide the bug.)
  2. Extract items from the chest using an EnderIO item conduit with at least one (preferably 3+) speed upgrade, inserting into a destination chest.
  3. Time the duration to move several stacks, with and without the incoming items to the source chest.

Affected Versions (Do not use "latest"):

  • EnderIO: 3.1.190
  • EnderCore: 0.4.1.66-beta
  • Minecraft: 1.10.2
  • Forge: 12.18.3.2254

Your most recent log file where the issue was present:

https://paste.ee/p/qsK34

commented

Please consider an 'upgrade' item that changes that behavior.
In this case, examining lastSlot+1 instead of lastSlot would remedy the unexpected slowdown.

Alternatively, please consider changing the default optimization slightly:
When enderIO empties the slot itself, check lastSlot+1 next time instead of lastSlot. This would not only remedy the behavior, but skip checking the slot when the expectation is that it's now empty.
Admittedly, adding a conditional to each transfer operation would probably cost a few cycles; I am hoping that you've already got some logic to hook in to so it's 'free'.

commented

Works as designed. What you see here is a side effect of Ender IO only transferring from one source stack on each operation in combination with the optimization that the slot it transferred items on the last operation is checked first. If you look at the chest's contents, you'll see that there will be one slot that is constantly being removed from (every .5 seconds) and added to. Until that slot becomes empty, Ender IO will not look at any other slot.