Performance Improvements - Part I #855
vishalnarkhede
started this conversation in
General
Replies: 2 comments
-
The above mentioned improvements are available on |
Beta Was this translation helpful? Give feedback.
0 replies
-
These changes have been released as part of 3.9.0. We have more improvements coming soon for image attachments and avoiding un-necenssary re-renders of Gallery component. Please stay tuned. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have received some complains around performance of RN SDK in case of high concurrency (messages coming in too fast), e.g., livestream applications. Recently we did some investigation and we have pinpointed some things which can be improved to boost the performance.
We are currently working on following fixes/improvements to avoid performance issues:
1. Throttling
Issue
https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/components/Channel/Channel.tsx#L674
Fix
2. Image Viewer
Issue
With the current designs when user opens an image attachment in image viewer, he can keep swiping through all the images (for messages that have been loaded so far) within channel. And we do a lot of work within SDK to keep smooth UX of image viewer opening and keeping track of all the messages with image attachments as the new messages keep coming in, even if user never opens the viewer. When the number of images in channel go above 50 or 100, this introduces quite some performance hit.
Fix
We can easily fix this issue by tweaking the UX for our image viewer. Instead of allowing user to swipe through all the images of channel, we should load the images of only single message from which image viewer was opened. This way we can avoid any work around image viewer, before user opens the viewer.
3. UX features
Issue
Following features are quite intensive for JS thread since it loops through entire list of messages.
Fix
getReadStates()
call if read events are disabled for application, since it involves looping through messages.channel.markRead()
if read events are disabled.onViewableItemsChanged
prop on FlatList, since we loop through messages here.Beta Was this translation helpful? Give feedback.
All reactions