Closed dedmen closed 6 years ago
Your change is a perf degradation as you are now making the configFile >> "CfgWeapons"
lookup every iteration instead of just doing it once.
Removing assigned items won't make a big difference. But it of course makes logical sense if you want to exclude them.
thanks !
This is a really controversial change.. Iterating through
items _unit
can end VERY badly.Without a backpack: Old: 35.3315us New: 157.935us
With a backpack full of ACE bandages: Old: 2951.2us New: 170.588us
Old code scales up with amount of items in inventory. New code doesn't.
Alternative
Without backpack: 25.463us With backpack: 279.848us
Still scales up. But the effect at the few-items-in-inventory end isn't as dramatic.
Or another alternative. Make your own specialized variant of CBA_fnc_uniqueUnitItems
Using that instead of calling the CBA func: without backpack: 74.1513us with backpack: 123.623us