robalo / mods

ASR stuff
GNU General Public License v2.0
23 stars 10 forks source link

Fix TakeEH Performance issue #8

Closed dedmen closed 6 years ago

dedmen commented 6 years ago

I'm sure you remember the lag when trying to quickly move items from a container into your inventory or the other way around.

I didn't expect ASR_AI to be responsible for it. But apparently it is.

brofiler_2018-04-09_14-18-00

It doesn't make sense to update the camouflage coefficient if all I did was take a ACE bandage out of a box.

robalo commented 6 years ago

Thanks !

robalo commented 6 years ago

The false is to prevent broadcasting the setvar. Why is that slower ?!

On Fri, Apr 20, 2018, 09:39 Dedmen Miller notifications@github.com wrote:

@dedmen commented on this pull request.

In asr_ai3/addons/skills/fnc_setUnitCamo.sqf https://github.com/robalo/mods/pull/8#discussion_r182957887:

@@ -13,7 +13,7 @@ private _gearItems = [_uniform, _vest, _ruck]; //uni must be checked first for g

//Don't do anything if the relevant items didn't change if (_unit getVariable ["asr_ai_skills_camoCache", []] isEqualTo [_gearItems, _tube]) exitWith {}; -unit setVariable ["asr_ai_skills_camoCache", [_gearItems, _tube]]; +_unit setVariable ["asr_ai_skills_camoCache", [_gearItems, _tube], false];

The ,false at the end is not required. And will make the script slower. Considering that this PR's whole aim is to make that script faster... That's not good.

Stupid oversight on unit by me...

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/robalo/mods/pull/8#pullrequestreview-113863347, or mute the thread https://github.com/notifications/unsubscribe-auth/ACFwyxUkL8YoocuZpxJIE3oBqx0ghh4Cks5tqYK-gaJpZM4TMchp .

dedmen commented 6 years ago

setVar doesn't broadcast by default. false is the default. So adding the false doesn't change anything. And it's slower because it's a extra command execution. false is a command, not a constant.

robalo commented 6 years ago

That's good to know, will fix, thanks !

On Fri, Apr 20, 2018, 10:23 Dedmen Miller notifications@github.com wrote:

setVar doesn't broadcast by default. false is the default. So adding the false doesn't change anything. And it's slower because it's a extra command execution.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/robalo/mods/pull/8#issuecomment-383006499, or mute the thread https://github.com/notifications/unsubscribe-auth/ACFwy_rhpwLD1VbHgoXtNx9PGLmiVXrKks5tqY0HgaJpZM4TMchp .