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

Resolve XEH redirect handlers #1056

Merged
merged 4 commits into from
Feb 8, 2019
Merged

Conversation

dedmen
Copy link
Contributor

@dedmen dedmen commented Feb 8, 2019

Resolve handlers that just point to a file.
Instead of executing call compile preprocessFileLineNumbers... every time before the EH is executed. Detect that pattern and resolve it at compile time and directly compile the target file.
Get's rid of (number of preInit scripts in ACE and CBA) calls to preprocessFile and compile at preInit
Get's rid of (number of postInit scripts in ACE and CBA) calls to preprocessFile and compile at postInit

After all the recent PR's to speed up pre/postInit this should give a nice additional boost.

Q: Should I implement that for Object handlers too? I guess yes because everything that uses the call preproc pattern will benefit, which I assume is done for objects too.

addons/xeh/fnc_compileEventHandlers.sqf Outdated Show resolved Hide resolved
@dedmen
Copy link
Contributor Author

dedmen commented Feb 8, 2019

End result of 8 hours of work

700ms CBA_fnc_compileEventHandlers ✔️
345ms CBA_fnc_supportMonitor ✔️
200ms activateAddons ✔️
530ms pylons postinit ✔️
850ms MCC_fnc_activateAddons ✔️
475ms ASR_AI preInit compiles ✔️
340ms cba_ui_init ✔️
110ms BWA3 ❓
130ms TFAR static radio compiles ✔️
100ms ace_mindetector compiles ✔️
XXXms getting rid of all the "compile preprocess" for all CBA/ACE pre/postInit functions.

3.67 seconds faster preInit assuming my numbers just add up.

Let's see how much difference the preproc roughly takes. Last run was 4.47s preInit.
After my XEH "fix" preInit is..... 3.69s about one second faster by just moving all this crap out of the way.

Copy link
Contributor

@commy2 commy2 left a comment

Choose a reason for hiding this comment

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

Fix tabs

@commy2 commy2 added this to the 3.10 milestone Feb 8, 2019
@commy2
Copy link
Contributor

commy2 commented Feb 8, 2019

Is this really worth it though?

@dedmen
Copy link
Contributor Author

dedmen commented Feb 8, 2019

Yes. Very much so. Got roughly a second faster preInit.
Without this you simply cannot cache the compiled code of the eventhandler. You are just caching a small snippet that makes no sense to cache and are constantly recompiling the actual eventhandling code.

@commy2 commy2 merged commit d1f5de1 into CBATeam:master Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants