Switch ReflexSettings to async resource loading #121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
This change switches ReflexSettings to load reflex settings via async resources load, vs the current non-async option.
This change means that reflex settings, together with all its references, are loaded into memory immediately upon game load, rather than during Awake of the first scene which has a SceneScope.
This change shouldn't change anything meaninfully for projects, for which project installers do not have many references. It should increase initialization times for projects where loading ReflexSettings via resources takes a long time (I've noticed it particularly on low-end mobile platforms).
It has the slight drawback of potentially using (at most) a few more megabytes of ram from the startup of the game, rather than from the first appearance of a SceneScope - since ReflexSettings is now loaded into memory more quickly.
I am not aware of any possible situation in which this would result in the breaking of anyone's Reflex-based project or even its tests.
The performance improvement persists even when ReflexSettings are marked as a preloaded resource, and the first SceneScope is present in the first scene.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I've implemented this myself in my reflex-based project. It improved total initialization time from app launch to user interaction by (at most) about 200ms (admittedly, our usecase is pretty heavy and the device in question was a low-end tablet).
Test Configuration:
Tested in editor and in builds on various android and iOS mobile devices, as well as various PCs across mac, linux and windows OSes. No devices experienced a regression, although the noted benefits were pretty variable.
Checklist: