mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user