[0.75] Autolinking performance benefits shipping in React Native 0.75 & Expo SDK 51 #814
Kudo
announced in
Announcements
Replies: 2 comments
-
nice work! 👏 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR: The upcoming stable version of React Native, 0.75, will come with significant improvements to the auto-linking algorithm.
Hi all,
We (Expo) would like to share some performance wins that are shipping with 0.75 which we worked on together with folks from the React Native team at Meta.
As part of the ongoing effort to define React Native framework (RFC759) and enhance the core system to better support all React Native frameworks, version 0.75 introduces a complete rewrite of the autolinking implementation, moving some of its functionalities into the core system.
Autolinking was first introduced in React Native 0.60, and has helped significantly developers to just include new libraries in their project with a simple
install
invocation. Since 0.60 the auto-linking algorithm has been living inside the Community CLI and has been improved significantly thanks to various community contributions.However, during the work for RFC759, we noticed the auto-linking responsibilities could be better split. So with 0.75 the autolinking logic is split as follows:
By default, your projects will use the
@react-native-community/cli
to discover modules, specifically with theconfig
command. So these projects will keep on working as usual, and your modules will be correctly linked.Splitting the autolinking logic allowed us to unlock performance gains, which are particularly significant for bigger projects with a lot of dependencies.
Specifically if you’re using Expo, the autolinking discovery logic has been rewritten to be ready for official adoption in the near future.
According to our benchmarks (see below), the new autolinking implementation runs between 1.35 and 1.64 times as fast on iOS, and between 2.88 and 10.24 times as fast on Android compared to the previous autolinking in React Native 0.74.
If you are using the latest Expo SDK in your projects, you can enable this new autolinking feature by setting the environment variable
EXPO_UNSTABLE_CORE_AUTOLINKING=1
.Please give it a try and experience the improvements firsthand.
Benchmarks
On the bare-expo app
Android is 2.88 times faster and iOS is 1.64 times faster.
On the react-conf app
Android is 10.24 times faster and iOS is 1.35 times faster.
Acknowledgement
We want to acknowledge the folks on the React Native team at Meta for working on this autolinking refactoring which enabled those performance savings, as well as the Community CLI maintainers for supporting this refactoring.
Beta Was this translation helpful? Give feedback.
All reactions