-
Notifications
You must be signed in to change notification settings - Fork 249
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
perf!: Optimize Filter Initialization with Concurrent Processing #6106
base: develop
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (40)
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6106 +/- ##
===========================================
+ Coverage 60.96% 61.04% +0.07%
===========================================
Files 814 815 +1
Lines 109253 109352 +99
===========================================
+ Hits 66611 66751 +140
+ Misses 34806 34782 -24
+ Partials 7836 7819 -17
Flags with carried forward coverage won't be shown. Click here to find out more.
|
478d714
to
502d4f3
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.
Great work splitting the function 👏
And thanks for the separate commit with moving files, made my review much faster 👍
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.
Thanks, looks much better now.
5a6e8db
to
7263420
Compare
Looks like you have BREAKING CHANGES in your PR. Check-list
|
Summary
This PR includes several improvements to the messenger's filter initialization and chat preview functionality:
Key Changes:
InitFilters
into smaller, more focused functions for better maintainability, and init filters concurrentlymessenger.go
to a new filemessenger_filter_init.go
ChatsPreview
methodstartHistoryArchivesImportLoop
The main improvements are:
InitFilters
function into smaller, focused functionsThe changes maintain backward compatibility while providing new filtering capabilities for chat previews.
With this PR, the duration for api
StartMessenger
has been reduced from 1.71s to 1.02s running with iphone XS Max. Relate mobile issueWhy added ability to filter chat previews by community vs non-community chats?
Let's take a look at
chatsPreviewResponse.log
, the response is very long which contains around 3.77 million characters. There's lots of chats related to community, when mobile frontend loads the chat preview list, actually it doesn't need the community chats for the chat list data soon, so we can split the long response into 2 parts(one with community chats one with non-community chats). With this solution, we can see the chat preview list almost in real time. It need wait around 2-3 seconds before this solution. But if we want to fix the performance issue totally, I'm wondering if we can useprotobuf
as data transfer mechanism rather thanjson
🤔, you can see there's lots of string starts with0x...
like0x04ffd68fe2bc7b2fceff949fd06c0f7a181ee5df2fc7ce9960c73a08e3c316a196dbae1700855a038bafe5091ab2cee9ac6fa77ed9bffe2053deeb97083d75d59f
@igor-sirotin @ilmottachatsPreviewResponse.log.zip