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

Read receipts processing dramatically slows down UI #1899

Closed
SBiOSoftWhare opened this issue Jun 7, 2018 · 1 comment
Closed

Read receipts processing dramatically slows down UI #1899

SBiOSoftWhare opened this issue Jun 7, 2018 · 1 comment
Milestone

Comments

@SBiOSoftWhare
Copy link
Contributor

Read receipts processing dramatically slows down UI.

The method getEventReceipts:eventId:sorted: from the MXMemoryStore is really time consuming. Unfortunately this method is called on main thread very often. This issue increases with the number of participants.

Here a sample from Time Profiler showing the time spent in the main thread especially the high percentage:

time-profiler-read-receipts

Solutions:

  1. Make call to getEventReceipts:eventId:sorted: asynchronously in background and then refresh UI. Needs to rewrite every calls to this method from Riot to handle asynchronous code. Room cells read receipt update should be done separately from other informations.
  2. Store only read receipts for visible messages to avoid processing thousands of unnecessary read receipts.
  3. Improve Matrix SDK cache performance by using an ORM framework like Realm or Core Data. With the amount of data, the different relationships and multithreading, simply using arrays and dictionaries to managing data sounds complex and error prone.

To me we should lazily retrieve read receipts and use an ORM framework like Realm.

@SBiOSoftWhare SBiOSoftWhare changed the title Read receipts processing slows down UI Read receipts processing dramatically slows down UI Jun 7, 2018
@SBiOSoftWhare
Copy link
Contributor Author

Related to #1820

manuroe added a commit that referenced this issue Jun 25, 2018
#1899

Build, cache and update read receipts on the processing queue.
@manuroe manuroe added this to the Sprint 11 milestone Jun 25, 2018
manuroe added a commit that referenced this issue Jun 25, 2018
#1899

Fix wrong alignment of read receipts avatars with their message
@manuroe manuroe closed this as completed Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants