-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
2x slower android builds after upgrading to 0.76 #48316
Comments
Warning Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:
|
@ethanneff Yes, this is expected. The New Architecture is written in C++ a lot of the code is written with that language. That's also why we ship prebuilds for React Native on Android. Regular apps does not have to rebuild React Native for Android and the build time is in the order or a few minutes. I assume that you are building React Native from source. Can I ask you why? Why do you have to maintain a fork of React Native instead of consuming the prebuilds? |
I personally see a 30% increase in build time on android (20min old arch vs 27min new) the only difference is simply newarch=true. My previous experience building rn from source with the default github actions runners takes ~1h. |
@lovegaoshi I'm not that big of an expert of Android build system, we should wait for @cortinico to be back. However, it would help if you can share your gradle logs to understand where the build is taking more time. In theory, if you don't have custom C++ code and you are consuming prebuilds from react native, the build time should not increase that much. |
As @cipolleschi mentioned, the New Architecture relies on C++ for component/module registration, so there is another compiler to run, link, etc. So yes is expected that building could be a bit slower than Old Arch. However I see from your build log that you're building all the Native Architectures: The suggestion is to build only the architecture you need (generally You can also consider using caching (such as You can read more about it here: https://reactnative.dev/docs/next/build-speed |
Description
Our Android builds are significantly slower after upgrading from
0.75.4
to0.76.5
A large amount of time is doing C work because of the new architecture. Is this expected?
2024-12-17T09:09:48.5675575Z [09:09:48]: ▸ [35m> Task :app:buildCMakeRelWithDebInfo[arm64-v8a][0m
4 minutes2024-12-17T09:14:01.6679960Z [09:14:01]: ▸ [35m> Task :app:buildCMakeRelWithDebInfo[armeabi-v7a][0m
2 minutes2024-12-17T09:17:40.9667954Z [09:17:40]: ▸ �[35m> Task :app:configureCMakeRelWithDebInfo[x86]�[0m
30 seconds2024-12-17T09:18:10.8667528Z [09:18:10]: ▸ [35m> Task :app:buildCMakeRelWithDebInfo[x86][0m
2 minutesaSteps to reproduce
./gradlew assembleRelease assembleDebug
on a react native without framework0.75.4
speeds to0.76.5
speedsReact Native Version
0.76.5
Affected Platforms
Runtime - Android
Areas
JSI - Javascript Interface, Codegen
Output of
npx react-native info
The text was updated successfully, but these errors were encountered: