Closed Naosyth closed 5 years ago
@Naosyth Could you share your profiling output as described here?: https://github.com/CyclopsMC/CyclopsCore/blob/master-1.12/.github/CONTRIBUTING.md#performance-issues-snail
GitHubMinecraft library mod for EvilCraft, Integrated Dynamics and others. - CyclopsMC/CyclopsCore
@rubensworks Sure: sample_piping_to_importer.zip
This is my test set up, for reference, piping in a steady steam of cobblestone:
While the servo was active, the time per tick for that dimension went from 3 ms to 30 ms
Note to self:
There are two main problems:
ItemStorageWrapper#getStackInSlot
becomes expensive due to the Iterators.get(storage.iterator(), slot)
call on networks with many slots. It would be better if this iterator would be more efficiently offsettable.IngredientCollectionPrototypeMap
is expensive for ItemStacks, as a lazy transform stream will apply quantities to each ItemStack, which causes copy()
calls, which will trigger semi-expensive gatherCapabilities()
calls.Possible solutions:
.next()
call return a lazy item, which would avoid the costly copy()
calls.IngredientCollectionPrototypeMap
so that no lazy transform iterator is needed.
Issue type:
Short description:
Piping items in to an importer causes lag. In my case, the world would go from < 3 ms/t to over 30 ms/t, even spiking to 60 ms/t. Piping them in to a chest and then importing them from the chest using an item importer immediately resolved my lag.
Steps to reproduce the problem:
Expected behaviour:
Piping items in to an item importer should import the items in to your network without creating significant lag.
Versions: