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
[CIS-265] Lazy model transformation for LLC #776
Conversation
Sources/StreamChat/Controllers/ChannelController/LazyChannelController.swift
Outdated
Show resolved
Hide resolved
.loadReplies(for: dto.id, limit: 25, context: context) | ||
.map(_ChatMessage.init) | ||
|
||
if dto.replies.isEmpty { |
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.
Don;t do DB queries, when here no need. It's super expensive.
Codecov Report
@@ Coverage Diff @@
## main #776 +/- ##
==========================================
- Coverage 89.13% 88.65% -0.48%
==========================================
Files 218 219 +1
Lines 8533 8570 +37
==========================================
- Hits 7606 7598 -8
- Misses 927 972 +45
Continue to review full report at Codecov.
|
434a27a
to
070a974
Compare
Sources/StreamChat/Controllers/ChannelController/ChannelController+SwiftUI.swift
Outdated
Show resolved
Hide resolved
Sources/StreamChat/Controllers/ChannelController/ChannelController+SwiftUI_Tests.swift
Outdated
Show resolved
Hide resolved
070a974
to
0397fb4
Compare
be22de0
to
93ad632
Compare
@b-onc Since Denis has a day off today, I finished the PR. Can you please review it? |
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.
ff4b334
to
9846d96
Compare
Improve performance of CoreData observers by introducing
LazyCachedMapCollection
, data structure that applies transformations to underlying sequence on read access.Decrease amount of DB queries on DTO -> Model transformation when possible.
Huge FPS drop on channel open happens not because of message list layout or message load (affects it, but not critical).
Apparently when we open channel, channel list observer overload CPU by making useless job.