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

CP-8525: Improve Android performance (polyfill promise with es6-promise) #1293

Merged
merged 8 commits into from
May 8, 2024

Conversation

atn4z7
Copy link
Collaborator

@atn4z7 atn4z7 commented May 8, 2024

Description

Ticket: CP-8525

There seems to be an issue with async calls such as setTimeout, promise,...after upgrading to RN 0.73.x which slows down the app on Android. From my investigation, this has to do with event loop implementation in Android JSC. It looks like this might already be fixed in RN 0.74.x (with new arch and bridgeless mode enabled) but we are unable to upgrade right now since some packages such as react-native-quick-crypto, react-native-pager-view are not compatible yet.

As a workaround, I'm replacing the promise polyfill that RN uses (https://github.com/then/promise) with es6-promise. This prevents the app from freezing.

References:
facebook/react-native#33006
facebook/react-native#43396

Checklist

Please check all that apply (if applicable)

  • I have performed a self-review of my code
  • I have verified the code works
  • I have added/updated necessary unit tests
  • I have updated the documentation

Copy link
Contributor

@ruijialin-avalabs ruijialin-avalabs left a comment

Choose a reason for hiding this comment

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

🔥

@atn4z7 atn4z7 merged commit 5c86a63 into development May 8, 2024
3 checks passed
@atn4z7 atn4z7 deleted the test-promise branch May 8, 2024 14:10
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.

2 participants