ubergarm / RimWorld-KanbanStockpile

RimWorld mod adding `Stack Refill Threshold` and `Similar Stack Limit` to stockpiles and deep storage inspired by kanban logistic control systems.
https://steamcommunity.com/sharedfiles/filedetails/?id=2287142613
MIT License
2 stars 3 forks source link

Implement faster Aggresive Similar Stockpile Limit check algorithm #6

Closed ubergarm closed 4 years ago

ubergarm commented 4 years ago

Instead of iterating over all pawns and checking current jobs, grab the private ReservationManager.reservations List<ReservationManager.Reservation> and iterate over all hauling jobs.

Test this on a large colony to make sure it isn't too CPU intensive.

ubergarm commented 4 years ago

Initial testing shows that iterating over all reservations is much more performant and provides better results (as vanilla algo's seem to queue up and reserve two hauling jobs at a time so this let's a pawn haul for a longer period of uninterrupted time so less overhead shuffling jobs)