Performance-Fish icon indicating copy to clipboard operation
Performance-Fish copied to clipboard

Deduplicate the list of haulables if the cache is still dirty after an update

Open ProTriforcer opened this issue 8 months ago • 3 comments

Some mods occasionally leave duplicates in the list of haulables. As a result, the counts in the list and the cache are never equal, invalidating the cache as soon as it's made and ruining performance. This should handle such situations a lot more gracefully

ProTriforcer avatar May 07 '25 22:05 ProTriforcer

What mod is doing that? Simply removing the new entries added by that other mod sounds a lot like it'd break the functionality they're added for

bbradson avatar May 08 '25 07:05 bbradson

Pretty sure it's Pick Up and Haul. Sometimes it just starts a job with every item listed twice, and the very next message in the log is "Dirty cache after update". That's after this change, of course, before it would just silently make ListerHaulables:Check take ~0.033ms every call instead of ~0.000ms until i reload a save. I don't think PUAH is doing anything intelligent here, but i suppose this could mess with other mods. I guess this should be a toggle in the options? I know the proper thing to do is to track down and fix whatever is messing up the haulables list, but that's hard

ProTriforcer avatar May 08 '25 12:05 ProTriforcer

I know PUAH sorts haulables by distance before deciding what to pick up as an optimization, but it definitely shouldn't be adding anything there. Was this tested with a minimal modlist?

bbradson avatar May 08 '25 12:05 bbradson