Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
FlatList performance slow for large changes to list #16186
Is this a bug report?
Maybe. I think this is an extension of #13649
Have you read the Contributing Guidelines?
Packages: (wanted => installed)
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.
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.
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.
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?
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.
@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.
mybe you can try this:
if it is useful for you ,star me ,please
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.