-
Notifications
You must be signed in to change notification settings - Fork 739
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
Fix slow paged room list regression #6233
Fix slow paged room list regression #6233
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the doc change is very much needed. There's a similar method in RoomService
called getPagedRoomSummariesLive
that feels like the default method used while getFilteredPagedRoomSummariesLive
sounds like it's only used in FilteredRoomsActivity
. This issue highlights that this isn't the case, and it would be good to make that clearer in the code through these java docs
*/ | ||
fun getFilteredPagedRoomSummariesLive( | ||
queryParams: RoomSummaryQueryParams, | ||
pagedListConfig: PagedList.Config = defaultPagedListConfig, | ||
sortOrder: RoomSortOrder = RoomSortOrder.ACTIVITY | ||
sortOrder: RoomSortOrder = RoomSortOrder.ACTIVITY, | ||
getFlattenParents: Boolean = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getFlattenParents: Boolean = false, | |
getFlattenParents: Boolean = false, // Heavily impacts performance when true. Only use when space parent is absolutely required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, but please add this mention in the Kdoc and not here, or it will not be exported.
* TODO Doc. | ||
* @param getFlattenParents When true, the list of known parent and grand parent summaries will be resolved. | ||
* This can have significant impact on performance, better be used only on manageable list (filtered by displayName, ..). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels weird to have a partial java doc covering only one parameter. I would resolve this TODO and complete the javadoc here (and preferably for the method above too, to avoid confusion later)
* TODO Doc. | |
* @param getFlattenParents When true, the list of known parent and grand parent summaries will be resolved. | |
* This can have significant impact on performance, better be used only on manageable list (filtered by displayName, ..). | |
* Gets filtered page of room summaries so that [insert use of filtered here] | |
* | |
* @param queryParams - tba | |
* @param pagedListConfig - tba | |
* @param sortOrder - tba | |
* @param getFlattenParents When true, the list of known parent and grand parent summaries will be resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use tba
you should keep the TODO
val spaceName = roomSummary.spaceParents?.firstOrNull()?.roomSummary?.name | ||
val spaceName = roomSummary.flattenParents | ||
.takeIf { it.isNotEmpty() } | ||
?.joinToString(", ") { it.name } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this is nice, I'm thinking now to maintain parity with web, we only take the last element in flattenParents
for the subtitle. If design would deem it's better to have all parents separated by comma, we can have a meta ticket to change that across all platforms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look to me what web is taking the last one only. What are the requirement exactly?
Can you take over it as I believe you are the one that initialy developed it?
@BillCarsonFr were you able to reproduce or you just assume that flattened parents is the cause? I've tested with many spaces and there were no problems with db read, so if you can reproduce, could you share your setup? Also, issue was created before flatten parents flag was added (PR). So I'm not sure this actually fixes problem |
I can reproduce 100% with my personal account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a file for the changelog
3dfeeda
to
adf8c5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after a static review.
Please do not merge on develop, I will create a hotfix, as it's blocking the release 1.4.18.
3835755
to
89e528d
Compare
(force push to revert commit made on the wrong branch) |
Kudos, SonarCloud Quality Gate passed! |
All the 4 commits have been cherry-picked to create the hotfix 1.4.19. The changes are now on |
Another regression #6272 that didn't make it to 1.4.19... |
Type of change
Content
A new parameter was added to resolve the list of parent summaries when loading the rooms paged list.
This param is affecting performances a lot when you have some decent space hierarchy. And it was called unproperly when displaying the regular room list (should only be needed for search/filter rooms).
Also the new added
flattenParents
field (that was slowing the queries) was never used. Instead the space parent was used. I think improperly because it only reflect the presence of am.space.parent
relation, that is not used to decide hierarchy (m.space.child
) are used for that.@ericdecanini can you confirm?
See #3830 regarding recent degradation of performances.
Tested devices
Checklist