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

Common - Add cache to fnc_isModLoaded #8794

Merged
merged 5 commits into from
Jan 30, 2022

Conversation

LinkIsGrim
Copy link
Contributor

@LinkIsGrim LinkIsGrim commented Jan 26, 2022

When merged this pull request will:

  • Title.
  • Move remaining manual CfgPatches lookups to use the function.
  • Change a CfgVehicles >> typeOf lookup to configOf.
  • Change overpressure damage to only show blood effect if damage is enabled.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@LinkIsGrim LinkIsGrim changed the title Common - Add cache to FUNC(isModLoaded) Common - Add cache to fnc_isModLoaded Jan 26, 2022
@jonpas
Copy link
Member

jonpas commented Jan 26, 2022

Is it actually faster? Config reading is pretty fast to begin with, and this only does one config read. Benchmarks would be nice.

@LinkIsGrim
Copy link
Contributor Author

Old:

Result:
0.0178 ms

Cycles:
10000/10000

Code:
["ACE_Medical"] call ace_common_fnc_isModLoaded

PR:

Result:
0.0068 ms

Cycles:
10000/10000

Code:
["ACE_Medical"] call isModLoadedCached

@PabstMirror PabstMirror added this to the 3.14.2 milestone Jan 28, 2022
@PabstMirror PabstMirror added the kind/optimization Release Notes: **IMPROVED:** label Jan 28, 2022
@PabstMirror PabstMirror merged commit 9ff5d34 into acemod:master Jan 30, 2022
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.

3 participants