react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Performance: Blank app has frame drop on Android

Open bonnmh opened this issue 6 months ago • 12 comments

Description

https://github.com/user-attachments/assets/f6b9aae3-5405-43cd-937a-193e022426e2

Steps to reproduce

🐞 Bug Report: Empty Project Drops Below 60 FPS on Interaction

📝 Description

Even with a completely empty React Native project, performance drops significantly when interacting with the screen (e.g., touching anywhere). The frame rate quickly falls below 60 FPS, even though there’s no content or rendering complexity.

📱 Reproduction Steps 1. Create a new React Native project (e.g., using npx react-native init TestApp) 2. Use the following code in App.js:

import React from 'react';
import { View } from 'react-native';

export default function App() {
  return (
    <View style={{ flex: 1 , alignItems:'center', justifyContent:'center', backgroundColor:'pink'}} />
  );
}
3.	Run the app on a physical device
4.	Touch anywhere on the screen

🧪 Expected Behavior

Frame rate should remain at 60 FPS since there’s no content or computation in the app.

❗ Actual Behavior

Frame rate drops immediately after interaction. It feels sluggish even though the app is empty.

https://github.com/user-attachments/assets/f4b65f3f-7475-45d5-a627-dc1041e7d1e4

React Native Version

0.77.2

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

info Fetching system and libraries information...
System:
  OS: macOS 15.2
  CPU: (8) arm64 Apple M1 Pro
  Memory: 647.45 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.1
    path: ~/.nvm/versions/node/v20.18.1/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v20.18.1/bin/yarn
  npm:
    version: 10.8.2
    path: ~/.nvm/versions/node/v20.18.1/bin/npm
  Watchman:
    version: 2025.04.28.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/brian/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9619390
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 24.0.1
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/brian/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 16.0.2
    wanted: 16.0.2
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.2
    wanted: 0.77.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

info React Native v0.80.0 is now available (your project is running on v0.77.2).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.80.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.77.2&to=0.80.0
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Stacktrace or Logs

info Fetching system and libraries information...
System:
  OS: macOS 15.2
  CPU: (8) arm64 Apple M1 Pro
  Memory: 647.45 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.1
    path: ~/.nvm/versions/node/v20.18.1/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v20.18.1/bin/yarn
  npm:
    version: 10.8.2
    path: ~/.nvm/versions/node/v20.18.1/bin/npm
  Watchman:
    version: 2025.04.28.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/brian/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9619390
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 24.0.1
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/brian/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 16.0.2
    wanted: 16.0.2
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.2
    wanted: 0.77.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

info React Native v0.80.0 is now available (your project is running on v0.77.2).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.80.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.77.2&to=0.80.0
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

MANDATORY Reproducer

.

Screenshots and Videos

No response

bonnmh avatar Jun 16 '25 15:06 bonnmh

[!WARNING] Unsupported version: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

react-native-bot avatar Jun 16 '25 15:06 react-native-bot

[!WARNING] Unsupported version: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

react-native-bot avatar Jun 16 '25 15:06 react-native-bot

[!WARNING] Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


You can read more about about it on our website: How to report a bug.

react-native-bot avatar Jun 16 '25 15:06 react-native-bot

Hi @bonnmh , version v0.77 is no longer supported. Please add a reproducer in version 0.80.x

devanshsaini11 avatar Jun 17 '25 07:06 devanshsaini11

Hi @bonnmh , version v0.77 is no longer supported. Please add a reproducer in version 0.80.x

To be fair, it's only

import React from 'react';
import { View } from 'react-native';

export default function App() {
  return (
    <View style={{ flex: 1 , alignItems:'center', justifyContent:'center', backgroundColor:'pink'}} />
  );
}

maksymhcode-care avatar Jun 17 '25 07:06 maksymhcode-care

@maksymhcode-care Since the issue was reported on react-native 0.77.x—which was released few months ago—the issue may already have been addressed in a newer version. Could you please try upgrading to latest react-native version 0.80.x and let us know if the issue still occurs? Thanks!

devanshsaini11 avatar Jun 17 '25 08:06 devanshsaini11

@devanshsaini11 Thanks for getting back to me.

Exactly. The core of the issue is that this FPS drop is visible on a completely blank screen, but specifically on low-end devices. This is what makes it worrying, despite 0.77.2 being a great release otherwise.

Happy to provide more details if needed!

bonnmh avatar Jun 17 '25 08:06 bonnmh

@bonnmh can you try the same test using 0.80 instead of 0.77?

cipolleschi avatar Jun 17 '25 12:06 cipolleschi

@cipolleschi Okay, I will send you the test results soon

bonnmh avatar Jun 18 '25 02:06 bonnmh

Yes, under the new architecture, Android devices experience serious frame drops, especially mid- to low-end phones. For example, in one scenario: when I wrap a FlashList with KeyboardAvoidingView using behavior="padding", the list stutters badly when the keyboard pushes it up.

418442040 avatar Jun 18 '25 08:06 418442040

This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.

react-native-bot avatar Dec 16 '25 05:12 react-native-bot

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

react-native-bot avatar Dec 16 '25 05:12 react-native-bot