-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Description
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
- Create a page/modal with 10-30 API calls.
- Test in React Native 0.74.x or later (Bridgeless).
- Measure load time and UI responsiveness.
- 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