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

Performance fix for Android by enabling hardware acceleration #116

Merged
merged 1 commit into from
Apr 22, 2021

Conversation

k-ibr
Copy link

@k-ibr k-ibr commented Apr 22, 2021

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.

@k-ibr k-ibr changed the title Performance fix for Android by allowing hardware acceleration Performance fix for Android by enabling hardware acceleration Apr 22, 2021
@k-ibr
Copy link
Author

k-ibr commented Apr 22, 2021

@Naturalclar this fixes some huge performance issues for Android users, would be nice if we can get this merged asap so I can get to work on an Expo PR, since that will take a bit of time as well 😉

@k-ibr
Copy link
Author

k-ibr commented Apr 22, 2021

Thanks for the approval @FonDorn 👏 can't wait to finally have this fix merged so I can start on the Expo PR

@FonDorn FonDorn merged commit bc019c7 into react-native-masked-view:master Apr 22, 2021
@FonDorn
Copy link
Collaborator

FonDorn commented Apr 22, 2021

@k-ibr thanks you. Please go ahead

@k-ibr k-ibr deleted the hardware_accelerated branch April 22, 2021 16:12
@k-ibr
Copy link
Author

k-ibr commented Apr 22, 2021

@FonDorn @Naturalclar can someone also please publish latest version to NPM (and Yarn)? thanks!

@Naturalclar
Copy link
Contributor

@k-ibr done! Should be published on npm now, thanks for the change 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants