-
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
FlatList performance slow for large changes to list #16186
Comments
The same performance problem occurs on Android. |
+1 I'm encountering the same issue trying to edit large lists mimicking iOS messaging app's edit functionality |
|
I had this problem and decided to ditch FlatList/SectionList after trying out every optimization solution available. Instead, I bridged native table view and it's super fast. |
@joonhocho Thank you for your suggestion. I see that you are a contributor - should I consider your comment official and close this issue? |
@arussellk No, I am just another user. I once committed a small change and got the badge. |
@joonhocho I've looked into a native iOS implementation, but don't have any objC experience. Do you have an example of how you did it? |
@andrew-wagner89 I will probably open source it in the future, but unfortunately not for a while. I don't have time for cleaning (refactoring) it up and making it open source yet. |
I have the same issue, the performance of FlatList is terrible... bad... |
Had the same issue. Fixed after a long testing session by removing React installation from Podfile which I needed for react-native-mapbox-gl and installed the map library manually. |
I have the same issue. I'm using a 2 columns FlatList list with about 120 items (including images). It doesn't render the items properly after about 40-50 rows! |
mybe you can try this: if it is useful for you ,star me ,please |
Same issue here, on Android is slow and iOS is fast. |
@joonhocho In your bridged native table view. Does you show RCTView's in cells, or cells also entirely native? |
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version? I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer. |
@arussellk have you managed to solve this yet? You could take a look at this article gathering info about all techniques I could find around the internet that should enhance a FlatList, so that you can still benefit from virtualization, once you work with such big lists. |
@filipemerker I was not able to improve the performance of FlatList and ended up writing a native app instead. |
I have similar issue , I wanted to change the background of all the selected items , that gave me hell , beside I had nested structure for my list , and that make it even worse. |
You might find the technique used in this article helpful, at least for me. |
Is this a bug report?
Maybe. I think this is an extension of #13649
Have you read the Contributing Guidelines?
Yes.
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 7.10.1
Yarn: Not Found
npm: 4.2.0
Watchman: 4.7.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: ^0.48.4 => 0.48.4
Steps to Reproduce
I have a FlatList that contains many items (1000+). It represents a lengthy checklist. I have a "Select All" button which causes every item in the list to be selected. The performance of rendering this is noticeably bad.
Note that in the Snack, I am only recreating a single object of id->boolean key/value pairs when a change is made. This is my effort to isolate FlatList performance.
Expected Behavior
I expected FlatList to be able to handle a list this size since it does not have to render very many items at a time. However, I suspect that since FlatList uses PureComponents it has to virtually recreate the entire list when I tap "Select All" which causes the performance hit.
Actual Behavior
If you tap a single row, there is a small amount of rendering lag.
If you tap "Select All" or "Deselect All" (whichever changes all the items in a list), there is a large amount of rendering lag.
Reproducible Demo
https://snack.expo.io/S1z6PMZnZ
I suspect that FlatList cannot do what I want. If that is the case, is there a different component that I've missed in the docs that I should try?
The text was updated successfully, but these errors were encountered: