Closed AlexiyOrlov closed 9 months ago
Thanks for reporting!
There's not much I can do about this on IT's end I'm afraid. The actual lag itself is coming from the code of pneumaticcraft, which in turn invokes the very costly ItemStack.copy()
.
The only thing that you could do on IT's end is lower the tickrate of the item importer (see its part settings).
Hm. I already reported this to Pneumaticcraft, but they said they can't do anything https://github.com/TeamPneumatic/pnc-repressurized/issues/1226
Modifying the tickrate is the only thing you'll be able to do then. See also this: https://github.com/TeamPneumatic/pnc-repressurized/issues/1226#issuecomment-1734263934
Hi, PNC author here. You're totally right that ItemStack#copy()
is an expensive op, but technically it's Forge that's doing it here :smile: For the Aerial Interface, I do need to wrap the player's vanilla Inventory
with something that mods can interact with, i.e. an IItemHandler
. And the docs for IItemHandler#extractItem
specifically state:
The returned ItemStack can be safely modified after, so item handlers should return a new or copied stack.
So I don't think there is much I can do here; if you have any thoughts, I'd be interested to hear...
(Note: not at all attempting to blame IT here, just to be clear!)
@desht Yep, I agree, there's not much that can be done to improve performance here using the IItemHandler
interface.
One possible solution however could be to look into the slotless item handler and the IInventoryState
, which is recognized by IT. (not saying you have to do this, just that it's an option :-) )
Issue type:
Short description:
If you place an item importer to extract specific items from aerial interface from pneumaticcraft, it will cause significant lag. I used Spark to find the cause.
Steps to reproduce the problem:
Versions:
Profiler output:
https://spark.lucko.me/FV8c66RiDE