Various performance tweaks (#474)

* Store and reuse room list placeholder avatars and last messages

* Cache and reuse HomeScreenRooms

* Reduce RoomSummaryProvider diff collection time

* Promote more logs to info

* Slighty tweak RustTracing to make it easier to configure

* Move TimelineProvider and RoomTimelineController item processing to background queues

* Prevent the timeline from stopping an ogoing decelerating scroll when starting backpaginating
This commit is contained in:
Stefan Ceriu
2023-01-20 16:40:23 +02:00
committed by GitHub
parent 70920550e7
commit ae8009d040
15 changed files with 167 additions and 95 deletions
@@ -56,7 +56,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
.store(in: &cancellables)
slidingSyncViewProxy.diffPublisher
.collect(.byTime(serialDispatchQueue, 0.1))
.collect(.byTime(serialDispatchQueue, 0.025))
.sink { [weak self] in self?.updateRoomsWithDiffs($0) }
.store(in: &cancellables)
}
@@ -80,7 +80,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
return
}
MXLog.verbose("Updating \(identifiers.count) rooms")
MXLog.info("Updating \(identifiers.count) rooms")
guard statePublisher.value == .live else {
MXLog.warning("Sliding sync not live yet, ignoring update.")
@@ -117,7 +117,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
}
fileprivate func updateRoomsWithDiffs(_ diffs: [SlidingSyncViewRoomsListDiff]) {
MXLog.verbose("Received \(diffs.count) diffs")
MXLog.info("Received \(diffs.count) diffs")
rooms = diffs
.reduce(rooms) { currentItems, diff in
@@ -136,7 +136,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
return updatedItems
}
MXLog.verbose("Finished applying \(diffs.count) diffs")
MXLog.info("Finished applying \(diffs.count) diffs")
}
private func buildRoomSummaryForIdentifier(_ identifier: String, invalidated: Bool) -> RoomSummary {