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

Android: Extremely slow rendering of offscreen components #30987

Closed
darajava opened this issue Feb 11, 2021 · 2 comments
Closed

Android: Extremely slow rendering of offscreen components #30987

darajava opened this issue Feb 11, 2021 · 2 comments
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@darajava
Copy link

darajava commented Feb 11, 2021

Description

On Android, when translating off-screen components onto the screen, it takes a very long time. When the function to bring them on-screen is triggered, it seems to completely block the main thread for (almost a) second. I am only rendering 100 simple elements and iOS can handle it even with a much greater pixel density. On Android, this issue is reproducible for me even on a high end phone.

React Native version:

System:
    OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Memory: 133.11 MB / 7.67 GB
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 15.6.0 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 7.4.0 - /usr/local/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 26, 28, 29
      Build Tools: 27.0.3, 28.0.3
      System Images: android-27 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 1.8.0_275 - /usr/bin/javac
    Python: 2.7.18 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2 
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

Automatically translate off-screen components into view (on Android) and you will see it takes an unreasonably long amount of time.

  1. Clone the minimal repo here: https://github.com/darajava/render-bug-android-react-native
  2. npm i
  3. npm run android

Expected Results

I expect Android to render the off-screen elements in a reasonable amount of time.

Link to repository and demo

https://github.com/darajava/render-bug-android-react-native

See these 2 videos for a comparison of how Android vs iOS handles it:

Android: https://youtu.be/KBP2HHMzAiU
iOS: https://youtu.be/fw-Prh_9HhY

I believe this is a bug in Android related to #28894

Even a workaround would be great.

Edit

I removed animations in the original repo. The problem is slightly improved, but persists and remains unusable.

@github-actions
Copy link

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

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 15, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

1 participant