You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, the new messages appear, disappear, then reappear.
Since it's not easy to follow what's happening in a group chat with Lorem Ipsum messages, I set up a bot that sends me 100 messages, numbered from 1 to 100. Make sure to lower the playback speed to see it better:
100_messages_from_bot.mp4
I profiled this bot example using Xcode instruments. And it turns out that when rapidly inserting 100 messages, MessageView is rendered 5095 times.
In fact, the huge number of view renders makes the rendering finish long after the last message was received by the app.
On the other hand, inserting 100 messages slowly results in only 656MessageView renders.
When does this happen in practice?
When would one receive messages very fast? There at least a couple of scenarios:
Opening a busy group chat, after staying offline for a while
Issue #169 is in fact the same as this bug, but triggered with fast message updates rather than insertions. This can be confirmed by watching the video provided there in very slow motion. We see a familiar behavior:
Hi, thank you for this library.
I'd like to report an issue that happens when rapidly inserting messages.
This can be demonstrated by changing the timer interval in the ChatExample app from 2 seconds to less than 80ms.
Minimal diff
ChatExample_demo.mp4
As you can see, the new messages appear, disappear, then reappear.
Since it's not easy to follow what's happening in a group chat with Lorem Ipsum messages, I set up a bot that sends me 100 messages, numbered from 1 to 100. Make sure to lower the playback speed to see it better:
100_messages_from_bot.mp4
I profiled this bot example using Xcode instruments. And it turns out that when rapidly inserting 100 messages,
MessageViewis rendered 5095 times.In fact, the huge number of view renders makes the rendering finish long after the last message was received by the app.
On the other hand, inserting 100 messages slowly results in only 656
MessageViewrenders.When does this happen in practice?
When would one receive messages very fast? There at least a couple of scenarios:
Issue #169 is in fact the same as this bug, but triggered with fast message updates rather than insertions. This can be confirmed by watching the video provided there in very slow motion. We see a familiar behavior:
169_in_slow_motion.mp4