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 Issues with React Native Bridgeless Architecture #47490

Open
santhoshkumarvgds opened this issue Nov 7, 2024 · 119 comments
Open

Performance Issues with React Native Bridgeless Architecture #47490

santhoshkumarvgds opened this issue Nov 7, 2024 · 119 comments
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Version Info Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@santhoshkumarvgds
Copy link

santhoshkumarvgds commented Nov 7, 2024

Description

The Bridgeless Architecture in React Native 0.74 and later introduces significant performance issues, particularly for apps with complex logic and high demands for UI responsiveness. Here are the main concerns:

Key Issues

1. Screen Load Times

  • Problem: Synchronous communication with the native runtime slows down screen loading, particularly when multiple API calls are made.
  • Impact: Initial loads are bottlenecked, reducing overall app responsiveness.

2. UI Responsiveness and Touch Lag

  • Problem: The switch to synchronous communication impacts touch response, causing a laggy and less fluid user experience.
  • Result: Reduced interaction quality and increased user frustration.

3. Lazy Module Loading

  • Default Behavior: Bridgeless architecture loads modules lazily by default, contributing to delayed responses in complex pages.
  • Partial Fix: Disabling lazy loading improves response slightly but doesn’t fully solve the underlying delay issues.

Comparative Performance with Older Versions

  • Testing Results:
    • React Native 0.71.8 (asynchronous bridge): Modal with 32 API calls loads in approximately 3 seconds.
    • React Native 0.74.x / 0.76.1 (bridgeless): Modal with only 14 API calls takes over 10 seconds.

Attempts to Improve Performance

  • Native Threads & Configuration Adjustments: Shifting API calls to native threads, and enabling/disabling options like Hermes and New Architecture, failed to yield significant performance improvements.

Call for Optimizations

The React Native community and core team are urged to provide optimizations or alternative solutions to enhance performance under the bridgeless architecture.

Feedback Needed: Community support and solutions for the architectural limitations causing these performance issues.

Steps to reproduce

  1. Create a page/modal with 10-30 API calls.
  2. Test in React Native 0.74.x or later (Bridgeless).
  3. Measure load time and UI responsiveness.
  4. Compare with 0.71.8 (Async Bridge).

Expected: Slower performance in the bridgeless versions.

React Native Version

0.74+

Affected Platforms

Runtime - Android, Runtime - iOS

Areas

Bridgeless - The New Initialization Flow, Other (please specify)

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1
  Memory: 206.23 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.14.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 10.7.0
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK: Not Found
  Android SDK: Not Found
IDEs:
  Android Studio: 2021.3 AI-213.7172.25.2113.9123335
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.7.4
    path: /Users/santhoshkumarvgds/.rvm/rubies/ruby-2.7.4/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0
    wanted: ^15.0.0
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.1
    wanted: ^0.76.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

The issue occurs when multiple API calls are made on initial screen load. The app becomes unresponsive and takes significantly longer to load the screen. Despite attempts to optimize by disabling lazy loading and using native threads, the issue persists. No crash or stack trace is generated, but the app's performance degrades considerably.

Reproducer

Reproducer: Unfortunately, I cannot provide a public repository or Expo Snack at this time. Please let me know if you would like further details or an isolated example of the issue.

Screenshots and Videos

No response

@santhoshkumarvgds santhoshkumarvgds added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Nov 7, 2024
@react-native-bot
Copy link
Collaborator

Warning

Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Needs: Triage 🔍 labels Nov 7, 2024
@react-native-bot
Copy link
Collaborator

Warning

Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@cortinico
Copy link
Contributor

Reproducer: Unfortunately, I cannot provide a public repository or Expo Snack at this time. Please let me know if you would like further details or an isolated example of the issue.

Yes we would need an isolated reproducer to look into this.

@arasrezaei
Copy link

I agree, there are lots of lags and crashes.
When I turn newArch off, the app is much smoother

@lovegaoshi
Copy link

i know this isnt particularly helpful to most others, but i also oberved performance degradation when migrating my app to bridgeless. my sprcific issue is react-navigation drawer opening is particularly choppy and wont switch screens completely. this is not exactly the rn teams fault, but the general DX/UX of our apps are still impacted

@JustJoostNL
Copy link

@lovegaoshi did you manage to fix that choppy drawer animation? The new architecture heavily slows down my app, is there any timeline for fixing this?

@lovegaoshi
Copy link

lovegaoshi commented Nov 13, 2024 via email

@YasinAkimura
Copy link

I can also confirm that the new arch is causing a few performance issues regarding responsiveness,
and I think react-navigation / expo-router are not ready for the new arch yet.

I can notice a significant lag in catching touch events when doing things quickly which may indicate the blocking nature of synchronous events?

Also a few bugs where Views seem to always fade / animate when layout changes or Text with adjustToFitSize and "unacceptable" lineHeight completely bug out but these are different issues.

@JustJoostNL
Copy link

Yeah the navigation and the overall responsiveness is horrible for me. I really hope this gets fixed because other than the performance issues, the new architecture is very promising. @santhoshkumarvgds are you able to create a minimal reproducible example?

@thespacemanatee
Copy link

I just wanted to add that on our project (which is quite massive but well-maintained), we also see significant performance degradations in debug mode on RN 0.76, even with the new architecture turned off. The problem might be related to hermes, which has steadily declined in performance over the past few releases. Can anyone confirm that 0.76 + new arch disabled also causes performance regressions?

@JustJoostNL
Copy link

I haven't tested without the new arch. But I can confirm that it's probably related to Hermes as the JS frames are very low which makes the app unresponsive.

@lovegaoshi
Copy link

lovegaoshi commented Nov 15, 2024 via email

@lovegaoshi
Copy link

lovegaoshi commented Nov 15, 2024

here for android. I have a MotionLayout (black bar at the bottom) that drags to expand to fullscreen. This is fluid with the old arch, new arch without expo's stack component, new arch with flatlist, but choppy with new arch and expo's stack or flashlist.

im not sure how useful this actually is, as this is an expo template (nowadays loaded with expo bloats. i used it for convenience) rather than a reproducer, and technically all react native components work as expected, just 3rd party libs are not.

not sure who to ping to get visibility.

@C0rren
Copy link

C0rren commented Nov 15, 2024

We have similar issues both in Android and iOS for our app running RN 0.76.2.

@katche70
Copy link

Unfortunately, I have to completely agree with this. I spent the whole week, full of anticipation and euphoria, painstakingly converting our app to the new architecture.
I am now completely disillusioned. There are a lot of places where you notice it's really stuck and you just can't get to the previous version on iOS. A lot of marketing for nothing. What a shame ☹️

@thespacemanatee
Copy link

thespacemanatee commented Nov 16, 2024

@cortinico @cipolleschi any chance the React Native team can look into this with the reproducer from @lovegaoshi? It's not feasible for me to provide my company repo for obvious reasons, and creating a new project is not going to truly reflect the performance regressions in more complex applications. I find it hard to believe that Meta is using 0.76 internally unless it is really a case of user error, but it seems unlikely as many people are facing this issue.

To reiterate, here is my "minimally reproducing setup" on a complex application:

  • RN 0.76
  • Expo SDK 52
  • Tried both New Architecture ON and OFF but performance impact is identical
  • Tried both hermes-2024-11-12-RNv0.76.2-5b4aa20c719830dcf5684832b89a6edb95ac3d64 and hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b but performance impact is identical

Performance is terrible on debug builds but seemingly faster than 0.75 on production, so the performance impact is only felt in debug mode. However, it makes for a horrendous development experience. Making changes and interactions take seconds.

I believe 0.76 has been the most insidious upgrade cycle because the changes according to the upgrade helper are minimal, but there are so many invisible moving parts under-the-hood that makes it impossible for us to have a reasonable timeline for any action items to pinpoint any sort of root cause. Many of us have to build features for our companies and upgrading should not be this tedious.

Although I greatly appreciate the work that the Meta team have put into this release, it has been an impossible one for us, and this is very worrying for the future of my company project due to the tight deprecation cycles in the React Native ecosystem.

@cipolleschi
Copy link
Contributor

@thespacemanatee I'm so sorry to hear that it is not working for you.

I find it hard to believe that Meta is using 0.76 internally unless it is really a case of user error, but it seems unlikely as many people are facing this issue.

At Meta we use React Native from main, the latest commit available, and yes, all our internal app are using or are migrating to the New Architecture. We might have some extra fix that we shipped between the branch cut of 0.76 (beginning of September) and today, but I can't think of anything that might dramatically change the performances of the app running in Debug.

Is this happening for Android, iOS, or both of them?
One thing that we saw causing slowness in builds was the NDEBUG flag. Release builds have these flag set to true to skip some extra check we run in debug that might be expensive and that can slow down the app.


Without a reproducer is pretty hard for us to do any work. The issue you are facing might be coming not from React Native core but from some external libraries you are using.
We have evidence of big apps running smoothly (e.g.: Bluesky, which is a pretty big app, on Android) with the New Architecture.

Multiple people are reporting the issues, so I'm not downplaying them, I'm sure they are there and real. It would be quite helpful to try and find the minimum common denominator of the set of libraries or patterns that are causing the slowness.

@thespacemanatee
Copy link

thespacemanatee commented Nov 20, 2024

@cipolleschi Thank you so much for the response.

Is this happening for Android, iOS, or both of them?

Both of them are slow in debug mode. Both are fast in production mode.

On our end, we will try to reverse engineer and determine whether an external dependency is causing this debug performance regression. The current list of dependencies we are using is reputable though as far as I can tell, comparing it against https://reactnative.directory/.

Also, CMIIW, but Bluesky is still using RN 0.74? Do they have a branch where they have validated that 0.76 + New Arch runs smoothly?

EDIT: They have a 0.76 branch that seems to be inactive currently, maybe someone from the team can chime in about the issues they are facing with upgrading.

@C0rren
Copy link

C0rren commented Nov 21, 2024

Small consolation, but for those of you running react navigation as your navigation package, it appears that native stack navigators run slightly faster than "normal" stack navigators for screen transitions.

@cipolleschi
Copy link
Contributor

@thespacemanatee can you try something for me. On iOS, can you try to modify the node_modules/react-native/scripts/cocoapods/utils.rb file like this:

    def self.add_ndebug_flag_to_pods_in_release(installer)
        ndebug_flag = " -DNDEBUG"

        installer.aggregate_targets.each do |aggregate_target|
            aggregate_target.xcconfigs.each do |config_name, config_file|
-                is_release = config_name.downcase.include?("release") || config_name.downcase.include?("production")
-                unless is_release
-                    next
-                end
                self.add_flag_to_map_with_inheritance(config_file.attributes, 'OTHER_CPLUSPLUSFLAGS', ndebug_flag);
                self.add_flag_to_map_with_inheritance(config_file.attributes, 'OTHER_CFLAGS', ndebug_flag);

                xcconfig_path = aggregate_target.xcconfig_path(config_name)
                config_file.save_as(xcconfig_path)
            end
        end

        installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
            target_installation_result.native_target.build_configurations.each do |config|
-                is_release = config.name.downcase.include?("release") || config.name.downcase.include?("production")
-                unless is_release
-                    next
-                end
                self.add_flag_to_map_with_inheritance(config.build_settings, 'OTHER_CPLUSPLUSFLAGS', ndebug_flag);
                self.add_flag_to_map_with_inheritance(config.build_settings, 'OTHER_CFLAGS', ndebug_flag);
            end
        end
    end

Then reinstall pods and try again?

What this does is basically to set the NDEBUG flag to every build config. This should disable some expensive runtime checks we are doing in debug mode to ensure the correctness of the framework. Those checks are disabled in production so that could be one of the causes why Debug is slower than development.


AFAIK, Bluesky made an Android release with the New Architecture that they asked users to try. I think they are also doing a phased rollout using the Play Store, but I am not completely sure.

@thespacemanatee
Copy link

@cipolleschi Thanks for the suggestion but unfortunately it's still as slow as before, though at least we can probably rule out NDEBUG as the root cause.

@cipolleschi
Copy link
Contributor

To set expectation, I'll be off next week and @cortinico will be back on Thursday.

We will try to prioritize this once we are back.

@mobinni
Copy link

mobinni commented Feb 22, 2025

I guess Text in particular has issues in Fabric, honestly most of our app was fine in the upgrade, outside of some visual regressions and third party library crashes.

Resource intensive screens (many api calls, streaming updates, etc) seem to have suffered and require different strategies that are GPU based like Skia

It's hard to say if this is RN or a combination of RN and third party libraries. The thing is when I profile text updates on Paper for Android it's still pretty bad if it's very fast

Another thing is that even opening an RN base modal jitters on heavy computational pages, not sure what's going on there

@wfern
Copy link
Contributor

wfern commented Feb 23, 2025

Guys, without a repo or snack is IMPOSSIBLE to help.

@pleerock can't you put that emoji component in a expo snack and share with us? You can create 2, one in SDK 51 (old arch) and another in SDK 52 (new arch), it will have the same code and it's very fast to do.

@mobinni
Copy link

mobinni commented Feb 23, 2025

After digging a bit more I don't actually think Text has regressed itself, I think there's something fishy with react-navigation and screens in the background continuing to update and destroy FPS 🤔 @wfern I will try to put together a reproducer but trying to get something together that emulates a large production app is difficult

@efstathiosntonas
Copy link

hey folks, reanimated 3.17.0 is out with some memory leaks fixes, can someone upgrade and test it out?

@mobinni
Copy link

mobinni commented Feb 24, 2025

@efstathiosntonas It seems to be stable, it doesn't help with the FPS issues I mentioned or the KeyboardAvoidingView not triggering

@lovegaoshi
Copy link

I've got another pointer, though probably not applicable to many others on this thread.

My app uses a bunch of self-updating hooks while the app is in the background. I found some of them will cause a severe performance degradation when the app is minimized for a long time (5 min) then resumed, only in the new arch. The screen either froze for 5s+ or became a white screen of death. My hypothesis is adding a check if Appstate is not active before the setState will solve this issue.

@madjique
Copy link

madjique commented Mar 7, 2025

Can the React Native maintainers give us updates ? New versions are released, but the same problems persists with performance degradation and fps drops when enabling the new architecture.
Please can you guys give us at least a heads-up if there is a plan on this or you guys are considering this as an outside issue related to used libraries ?

@cortinico
Copy link
Contributor

Can the React Native maintainers give us updates ? New versions are released, but the same problems persists with performance degradation and fps drops when enabling the new architecture.

I'm following this thread, but I still have to see a reliable reproducer/video that we can look into.

Without reproducers we can't really help you folks, you might be writing code that this is just not performant. Or there could be a bug inside the core of React Native. Sadly without seeing your projects there is not much we can do.

@hosseinmd
Copy link

Without reproducers we can't really help you folks, you might be writing code that this is just not performant. Or there could be a bug inside the core of React Native. Sadly without seeing your projects there is not much we can do.

Bule sky seems to have same issue too, You could check it.

@lovegaoshi
Copy link

At least for me, I have a really hard time reproducing my performance issue on a small scale reproducer - it is quite apparent in my app, but when u take out the bells and whistles the performance lag becomes acceptable/unnoticeable.

With that said if anyone just need a project to show that the new arch has performance issues, heres mine. I have newarch and oldarch both compiled on android with the only difference between them is simply enabling the flag. Throughout use, the miniplayer animation becomes noticeably laggier when there is media playing in the new arch, on my Samsung S21. All I know as a dev is I switch to newarch with one line, and I see lag. If the old arch works fine I dont really see the point being only me writing crap code. It could be me having a lot of data/assets loaded in the app while I'm using it, it could be my phone is not particularly strong anymore, it could be only via prolonged period of use that eg. the expo people refused to acknowledge my app has issues.

I do know quite a few newarch workarounds at this point from debugging my mess - one being the flex calculation when there is a resizing event is much slower than old. I have to pin the view height instead of using flex for the new arch. This directly apply to the miniplayer animation I mentioned above and was a major source of performance degradation for my app. Another being updating states while the app is in the background will cause a major lag/white screen of death when the app is resumed on android.

@chriszs
Copy link

chriszs commented Mar 9, 2025

Maintainers have been pretty diligent about tracking down New Architecture performance regressions in other cases when those are clearly demonstrated. If someone can demonstrate a specific issue using React Native Reproducer with example code I think this'll be addressed much faster.

@ustuncem
Copy link

ustuncem commented Mar 9, 2025

Hello @cortinico,

I previously provided a minimal reproduction but haven't received any feedback on it, except from @kirillzyusko, who suggested trying the new version. After switching to version 0.76.5, the crash issue was resolved. However, performance issues persist on both iOS and Android.

Due to the nature of the projects where we are experiencing these issues, it's quite difficult to create a minimal reproduction. Nevertheless, I have partly open-sourced my project and reduced it as much as possible here: GitHub Repository.

This is a New Architecture-enabled project that I have been developing for the past five months, and it relies heavily on @shopify/flash-list and @gorhom/bottom-sheet. While testing, I noticed that screens with only a single element perform well and work perfectly. However, if you navigate to src/app/(app)/(tabs)/account.tsx, enable ProfileView, and comment out the component (which I have already done), performance issues immediately appear. Once enabled, navigating between screens becomes extremely laggy.

Digging further, I disabled ProfileView again (which is just a simple ScrollView with some links in it) and navigated to the home screen (src/app/(app)/(tabs)/home.tsx). There, I enabled FilterTagList, which is a FlashList that, as you know, uses C++ at its core. Once enabled, the lagging starts instantly.

Looking even deeper, the @gorhom/bottom-sheet package performs very poorly with the New Architecture. Since it heavily depends on react-native-gesture-handler and react-native-reanimated, it seems to struggle with performance.

In the production-ready version of my app, with all its features enabled, memory leaks occur in the New Architecture, and I see logs related to react-native-reanimated trying to access and modify a shadow node, which causes crashes:
logs.txt.

I have reduced the base code as much as possible, but in order for you to see the modals and bottom sheets, I have kept the map and the secrets in an .env file. For security reasons, I will change them once you confirm that you have investigated the reproduction.

Any feedback is welcome, and I am happy to make adjustments based on your revisions and suggestions. The issues are similar on Android as well.

Additionally, Dan Abramov commented on this issue, mentioning that Bluesky is also experiencing similar problems and that they will investigate further. Has there been any development on this? Have they identified the root cause of the issue?

@LouisSyfer
Copy link

The problem may come from react-native-reanimated. I’ve been guessing that for some time. I have had problems with this package in the past, so it would not be really surprising

@ustuncem
Copy link

ustuncem commented Mar 9, 2025

The problem may come from react-native-reanimated. I’ve been guessing that for some time. I have had problems with this package in the past, so it would not be really surprising

Yeah logs seem to point us in that direction but @lovegaoshi s find is also interesting. Scrollview's that has flex: 1 on their style prop and flexGrow: 1 on their contentContainerStyle seem to cause performance issues because of the way height is calculated on the new arch. Maybe contributers can focus on these two points on the example, I provided both. I kept the ProfileView example especially for that

@mobinni
Copy link

mobinni commented Mar 10, 2025

After a lot of individual profiling of various parts of the ecosystem I came to find most of the performance issues stem from 3rd party libraries @ustuncem we noticed the same behaviour with gorhom, however we are just looking to remove our usage. The library is needlessly complex.

In terms of navigation becoming laggy I found that this is mostly due to the lack of virtualization (usage of flatlist/sectionlist) for complex screens when profiling with the react profiler. This lag would subside,

@BenIrving
Copy link

BenIrving commented Mar 10, 2025

We have specifically seen extreme performance degradation when upgrading from 76 to 77 last week, with new arch enabled. Both iOS and Android.

Has anyone else noticed degradation specifically around that update?

We have begun to investigate & debug, will report back if we find anything.

@ustuncem
Copy link

ustuncem commented Mar 10, 2025

After a lot of individual profiling of various parts of the ecosystem I came to find most of the performance issues stem from 3rd party libraries @ustuncem we noticed the same behaviour with gorhom, however we are just looking to remove our usage. The library is needlessly complex.

In terms of navigation becoming laggy I found that this is mostly due to the lack of virtualization (usage of flatlist/sectionlist) for complex screens when profiling with the react profiler. This lag would subside,

Hello @mobinni thanks for the response.

I have been using bottom-sheet since its version 3 was released and it was working fine up until now, new architecture era of the react native. I am fine with migrating and implementing my own bottom sheet solution but I dont think its the root cause of this issue. ShadowNode commitments to update the UI from reanimated is leaking some memory and I think that's the core reason why reanimated based packages aren't working performantly(react-navigation, bottom-sheet, basic libraries that every project installs instantly when any of us inits a react native project). Also I am using FlashList and that's also leaking memory because of the same reason reanimated is not performant. Upon scrolling up and down on FlashList for performance, views that aren't visible on the viewport are removed from the ShadowTree and that's commited also using React Native's ::commit function. Scroll a few times and boom the app crashed and logs that :commit function killed a thread in the system. I don't know which action to take other than provide a minimal reproduction for this issue so if anyone can point me in a direction I am more than happy to take action to solve this problem. If I should talk with the reanimated guys or flashlist guys or basically anyone that uses the C++ bridge and uses the ShadowNode::commit function, I am happy to start threads there also

@mobinni
Copy link

mobinni commented Mar 10, 2025

@ustuncem Sorry I didn't mean to say that the root cause of this isn't related to the new architecture, personally I have just fought with the bottom sheet library for too long 😅. However it isn't react-native, but reanimated that plays a big role here.

Which I believe is being addressed here - software-mansion/react-native-reanimated#6776

In terms of the flashlist performance, I have not noticed similar issues, and we use it quite extensively. Happy to take that one offline and see if we can find a fix for your use-case

@BenIrving We went from 0.76 to 0.77 and did not notice any significant drop-off. Is it isolated to a particular flow in your app or systemic?

@DorianMazur
Copy link
Contributor

@mobinni did you have the new architecture enabled in versions 0.76 and 0.77?

@mobinni
Copy link

mobinni commented Mar 10, 2025

@DorianMazur yes we did have new arch enabled on both. Most of our performance regressions were honestly either screens doing too much processing that hadn't been maintained and/or bugs with reanimated/reat native screens etc

@BenIrving
Copy link

@ustuncem Sorry I didn't mean to say that the root cause of this isn't related to the new architecture, personally I have just fought with the bottom sheet library for too long 😅. However it isn't react-native, but reanimated that plays a big role here.

Which I believe is being addressed here - software-mansion/react-native-reanimated#6776

In terms of the flashlist performance, I have not noticed similar issues, and we use it quite extensively. Happy to take that one offline and see if we can find a fix for your use-case

@BenIrving We went from 0.76 to 0.77 and did not notice any significant drop-off. Is it isolated to a particular flow in your app or systemic?

It's systemic to all of the apps that we have. Interestingly, upgrading to 78 resolved the issues we saw.

@DorianMazur
Copy link
Contributor

DorianMazur commented Mar 11, 2025

@mobinni Do you have any patches for the mentioned libraries? How did you solve these bugs? It would be really helpful if you could share more details. Thanks!

@ustuncem
Copy link

Hello @BenIrving are you using expo? I use expo and will try to migrate if the issues are solved in v0.78. Can you share the package versions that you are using so I can try with the working packages, especially reanimated related ones. Thanks in advance

@ustuncem
Copy link

I think the root cause is mentioned and highly discussed since December here: software-mansion/react-native-reanimated#6776 as @mobinni mentioned. It looks similiar to our problems discussed in this thread also. When the ShadowNode commit function is runned via an external library something happens that causes apps to crash or lag which seems to point us that a lot of libraries that are widely used aren't ready yet for the new architecture and we have to wait for them to get stable and adapt to the new changes. If anyone that has successfully migrated to the new architecture like @mobinni can share their experience and how they solved this pin points it would be amazing for us that are struggling.

@bartlomiejbloniarz
Copy link
Contributor

The issue from 6776 isn't really performance related. It's mostly concerned with a wrong state being mounted.

Upgrading to 0.78 might resolve your issues. We had a problem, where Hermes would perform a heavy StackOverflow check on Android and that would slow down the app. It was addressed here and the fix landed in Hermes for RN 0.78. But I'm not sure if that's the issue that has been tormenting everyone here, because it isn't really architecture dependent (and it is present only on Android). So unless you've been comparing architectures across different versions of RN, it shouldn't be the main concern.

@mobinni
Copy link

mobinni commented Mar 13, 2025

@bartlomiejbloniarz Anecdotally I did not see any noticeable improvements between architectures on 0.77 or 0.76 and I ran both in both modes. In 0.73 I did see that the old arch was slightly better on Android overall so this makes sense. Is there a way to backport the patch if we're not ready for 0.78 and react 19?

Based on this thread as well it seems that this mainly affected JS calls to JSI functions, so heavy worklet based threads in reanimated, etc. ?

I guess that doesn't mean that other libraries won't get a massive boost from this, I just have limited insight into what other libraries would suffer from this issue.

@mobinni
Copy link

mobinni commented Mar 13, 2025

@DorianMazur it depends on the package and the use-case, from the bugs we found here are some current guidelines that don't address the root cause but unblock:

  • Gorhom bottom sheet: we've just decided to roll our own for now.
  • Appsflyer: I posted a bug resolution here
  • RNGH / RN touch systems conflicting: pick one or the other don't use both at the same time (strange issue that I haven't been able to dig into)
  • react-native-collapsible-tab-view: We saw odd performance issues with switching between tabs or crashes, but we have a bespoke configuration wrapping this library so it's hard to say if it's reanimated, the library or something else
  • react-native-change-icon: I patched the entry here to support new arch but got no response from the maintainers
  • react-native-screens modal height issue: temporary remediation here while the team looks into it
  • Scrollview touchable area not touchable on low-end android: Wrap it with a view flex 1 (strange issue, not sure if it's RNGH, RN related or a combo of both)
  • Crashes on android for flashlist and back events in 0.76 for react-native-screens: update to 0.77+ and react-native-screens 4.6+
  • Keyboard avoiding view animation on iOS is just completely broken on scrollviews and the animation jumps instead of a smooth transition. We're looking to maybe swap keyboard controller libraries, but it has something to do with the animation manager of RN itself not triggering a smooth transition

@bartlomiejbloniarz
Copy link
Contributor

bartlomiejbloniarz commented Mar 13, 2025

@mobinni The issue that I described affects only reanimated (and packages that use reanimated). You would have to build React Native from source and apply the mentioned PR.

Other libraries could suffer from the fact that lots of time is wasted on those stack overflow checks triggered by reanimated usage of the Hermes runtime. But it's also very likely that this isn't the only issue that people in this thread experience.

@efstathiosntonas
Copy link

efstathiosntonas commented Mar 13, 2025

@bartlomiejbloniarz I think there was a line that could be added on react-native/gradle/libs.versions.toml to pin the version of the Hermes (so there's not need for applying the PR) but can't recall it, @cipolleschi has mentioned this on another issue iirc.

edit: I might be totally wrong though

edit 2: I believe It's on react-native/sdks/.hermesversion not libs.versons.toml, 0.78 hermes version is: hermes-2025-01-13-RNv0.78.0-a942ef374897d85da38e9c8904574f8376555388

@bartlomiejbloniarz
Copy link
Contributor

@efstathiosntonas I'm not sure that using different versions of Hermes and React Native is the safest option, there might be some mismatches, as they are not tested together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Version Info Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests