-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Android memory cleanup and optimizations #94799
Android memory cleanup and optimizations #94799
Conversation
06c5227
to
eddf1ff
Compare
eddf1ff
to
c2235d5
Compare
@BastiaanOlij FYI, sensor events will be disabled by default following this PR. This may constitute a breaking changes for mobile VR projects. I've added some warning logs for debug builds to help identify the issue for those projects. |
Should indeed be easy to have a warning if the MobileVRInterface is used. While you're add it, a long outstanding wish has been to be able to influence the sensor accuracy which by default is set to be more laggy and less noisy. This is great when used for your normal phone applications but not in a VR settings. |
I've added the warning when the getter for the sensor data is used while sensors are disabled, so that should cover both MobileVRInterface projects and projects using sensor data for other functionality.
Should be straightforward to add; I'll keep it in a separate commit. |
- Returns an empty list when there's not registered plugins, thus preventing the creation of spurious iterator objects - Inline `Godot#getRotatedValues(...)` given it only had a single caller. This allows to remove the allocation of a float array on each call and replace it with float variables - Disable sensor events by default. Sensor events can fired at 10-100s Hz taking cpu and memory resources. Now the use of sensor data is behind a project setting allowing projects that have use of it to enable it, while other projects don't pay the cost for a feature they don't use - Create a pool of specialized input `Runnable` objects to prevent spurious, unbounded `Runnable` allocations - Disable showing the boot logo for Android XR projects - Delete locale references of jni strings
c2235d5
to
a57a99f
Compare
Thanks! |
Miscellaneous set of code / memory cleanup and optimizations for the Android platform:
Disable sensor events by default. Sensor events can fire at 10-100s Hz wasting cpu and memory resources if the sensor data is not being used. Now the use of sensor data is behind a project setting allowing projects that need it to enable it, while other projects don't have to pay the cost for a feature they don't use.
Returns an empty list when there's no registered plugins, thus preventing the creation of spurious iterator objects
Inline
Godot#getRotatedValues(...)
given it only had a single caller. This removes the allocation of a float array on each callCreate a pool of specialized
Runnable
objects to dispatch input events and prevent spurious, unboundedRunnable
allocationsDisable showing the boot logo for Android XR projects
Delete locale references of jni strings