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

MXRoomSummary step #2 #310

Open
3 tasks
manuroe opened this issue Jun 16, 2017 · 0 comments
Open
3 tasks

MXRoomSummary step #2 #310

manuroe opened this issue Jun 16, 2017 · 0 comments

Comments

@manuroe
Copy link
Contributor

manuroe commented Jun 16, 2017

Now that app can cache data relative to a room into MXRoomSummary objects, we should not need to load anymore all rooms states, all rooms messages and all rooms account data at startup. We should just need to load all MXRoomSummary which will make app startup quicker. The app will also consume less RAM.

Here are some figures with my account:

[MXFileStore] Start data loading from files
[MXFileStore] Loaded room messages of 210 rooms in 869ms
[MXFileStore] Loaded room states of 210 rooms in 2562ms
[MXFileStore] Loaded rooms summaries data of 210 rooms in 804ms
[MXFileStore] Loaded rooms account data of 210 rooms in 610ms
[MXFileStore] Loaded read receipts of 210 rooms in 923ms
[MXFileStore] Loaded 12352 MXUsers in 600ms
[MXFileStore] Data loaded from files in 6370ms

Loading room state is the longest but without a clear cache (or a limited timeline in a /sync response), there are more and more messages in the store and loading room messages takes longer and longer.

The change implies asynchronous access to :

  • MXRoom object. It still exposes data got from the store and MXRoomAccountData.
  • MXEventTimeline, providing room messages. It is already asynchronous but it is based on a MXStore that has all data preloaded.
  • MXRoomState, the room state.

I suggest to keep things in memory when they have been asynchronously opened. It cannot be worse than keeping everything in memory as we do atm.

These objects must be opened, or populated on demand. There are 2 cases:

  • the user who wants to open a room in the app.
    The room will be a bit slower to open but the timing should be reasonable.
  • a /sync response contains data about a room.
    The additional time to open that room will be transparent to the end user because it will be part of the time to process the /sync response.
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

1 participant