Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach - Optimize creating children actions #6345

Merged
merged 2 commits into from
May 31, 2018

Conversation

mharis001
Copy link
Member

When merged this pull request will:

  • Optimize function that returns children actions using CBA_fnc_uniqueUnitItems and arrayIntersect
  • Rename the function: ace_attach_fnc_getChildrenAttachActions -> ace_attach_fnc_getChildrenActions

_actions pushBack [_action, [], _target];
};
};
} forEach (items _player);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh FFS the old script iterated through items?! wtf.

Copy link
Member

@kymckay kymckay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@kymckay kymckay added the kind/optimization Release Notes: **IMPROVED:** label May 16, 2018
@kymckay kymckay added this to the 3.13.0 milestone May 16, 2018
Copy link
Contributor

@dedmen dedmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor further improvement would be to move configFile >> "CfgMagazines" and configFile >> "CfgWeapons" into local variables outside the loop to spare a bit of runtime.

@commy2
Copy link
Contributor

commy2 commented May 16, 2018

One minor further improvement would be to move configFile >> "CfgMagazines" and configFile >> "CfgWeapons" into local variables outside the loop to spare a bit of runtime.

If you go that far, why not put these into globals at preInit? Guess that's something to consider for A4 if nothing significant changes.

@dedmen
Copy link
Contributor

dedmen commented May 16, 2018

If you go that far, why not put these into globals at preInit?

Because at that point the overhead of global var vs local var makes it not worth it anymore.

@Dystopian
Copy link
Contributor

git mv please :(

@PabstMirror PabstMirror merged commit ac3642d into acemod:master May 31, 2018
@mharis001 mharis001 deleted the attach-optimize-children-actions branch June 10, 2018 15:53
@PabstMirror PabstMirror modified the milestones: 3.13.0, 3.12.3 Jul 5, 2018
BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
* Optimize attach get children actions

* Store CfgMagazines and CfgWeapons config lookups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/optimization Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants