Performance fix for Android by enabling hardware acceleration #116
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.
Overview
We were having a lot of issues with performance on android such as explained in #110 but also some other users are facing in #88. By enabling hardware acceleration (default is set to software and results in extremely poor performance) for the Android Canvas we managed to solve these issues entirely. The project ran at 60fps, similar to IOS.
Here is a video showing software and hardware in action:
Hardware Acceleration OFF - performance is so bad it's impacting the recording, sorry.
Hardware Acceleration ON
Test Plan
When lots of re-renders are happening to a screen, the default code has extremely poor performance (as seen in the video). You can test this by creating a simple screen with a few MaskedView views and animating a few elements (which require for constant re-rendering at 60fps). You will notice this will result in bad performance overall only on Android and no issues on IOS.
It's a simple fix but it gets the results we have been looking for in our project.