branchrust_reboot/main/naval_update/industrial_optimcancel
12 Commits over 0 Days - ∞cph!
Rework buffer transfers, all tests now pass
Fixed a bunch of tests, buffer transfers still failing
Parse the conveyor's filters into item/blueprint/category dictionaries for faster lookups
Takes 800 filter checks from 1.4ms to 0.12ms
Disable pipe shadows at 25% of the cull distance
Cuts out a lot of shadow casters on big industrial bases
Big scary industrial conveyor refactor
Main goal here is to try and reduce how many loops are inside loops, as this scales poorly with large item containers (every slot from every input container is iterating over every slot on every output container)
Do a single prepass over all of the input items and run them through the conveyor filters, resulting in a single list of items that we can process, then attempt to move them to the output containers
Improved GetTotalItemAmount as this was a major time sink when using filters with min/max amounts. Now iterates over the items directly rather than using GetSlots (which triggers another full loop over the container for every slot)
Added an IEqualityComparer to ItemDefinition that just compares itemid, should speed things up when comparing ItemDefinitions
Wrapped the new time tracking in editor defines
TC's now cache their allowed construction items in a ListHashSet for faster checks
Not really worth doing in normal circumstances but it seems common to have junk items attempting to transfer into a TC constantly, this saves about 0.01ms on each attempt
Added an Input and Output item list that is populated during a conveyor move, allowing us to read and write items faster without having to use GetSlot (which could potentially iterate over the whole container each call)
Restructure some of the iterators in IndustrialConveyor.Move to iterate over the item list directly instead of using GetSlot
This removes all usages of GetSlot in the conveyor move system which can be called over 3k times in a bad conveyor move
Added a shortcut for LookAtIOEnt to resolve what item a storge cotnainer is attached to when holding the wire tool, resolves the multi second freeze in the editor (was faster in builds, but this should still be faster)