LuaTransportLine.get_detailed_contents() last item position without table allocation(s)
Posted: Fri Sep 11, 2026 8:21 pm
Table allocation and garbage collection from repeated transport line inspections is the biggest performance hit in my attempt to update/improve https://mods.factorio.com/mod/belt-overflow/downloads
What I need is just the position of the last item on the line. Right now to get that I have to call get_detailed_contents which returns the whole array[DetailedItemOnLine], with a flood of information I don't want or need.
Proposals:
get_detailed_contents(uint) returns just one DetailedItemOnLine
get_contents_positions() returns array[float], omiting the (item)stack and unique_id for each item
detailed_contents as an array proxy that supports # and [], like LuaTransportLine itself does to refer to the array of items without position or unique_id
What I need is just the position of the last item on the line. Right now to get that I have to call get_detailed_contents which returns the whole array[DetailedItemOnLine], with a flood of information I don't want or need.
Proposals:
get_detailed_contents(uint) returns just one DetailedItemOnLine
get_contents_positions() returns array[float], omiting the (item)stack and unique_id for each item
detailed_contents as an array proxy that supports # and [], like LuaTransportLine itself does to refer to the array of items without position or unique_id