-
Notifications
You must be signed in to change notification settings - Fork 79
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(SwapModal): improve the performance on tokenSelectorAdaptor #17035
base: master
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (14)
|
15ba288
to
a3e3068
Compare
a3e3068
to
e593642
Compare
@@ -49,38 +49,28 @@ QObject { | |||
property var enabledChainIds: [] | |||
property string accountAddress | |||
property bool showCommunityAssets | |||
property string searchString |
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.
this was not used anywhere. The search is done on UI level
Regression testing for Swap and Send is in progress. Send regression (simple send flag Off)Status: completed, no issues originated on this PR found. ✅ Known issues: (present on master build, unrelated to this PR) Swap regressionStatus: completed Issues found:
Screen.Recording.2025-01-10.at.2.35.26.PM.movKnown issues: (present on master build, unrelated to this PR) |
What does the PR do
Closes #16981
Fixing the performance issues related to the data transformations done in
TokenSelectorViewAdaptor.qml
by reducing the complexity.How was the data being processed
There are two inputs in the adaptor. The assets with balances submodels and a plain model of all tokens.
The output consists in a single model holding the assets with transformed balances as plain properties.
There are two options for the adaptor: To show all tokens, or only the tokens with positive balance. When the output model provides all tokens, the ones with positive balance will be the first ones in the list, with a specific
sectionName
property.The main culprit for the bad performance was that we've been transforming the two input models, concatenating the items in a single model and then process the model again to remove the duplicates and the other extra items based on network selection or unwanted items from the model with balances.
How it is processed now
The two input models are processed to provide lighter data as two different intermediate models. One holding only the items with positive balance and the other with all the assets, transformed to provide the data in the necessary format. These two models are joined using the left join proxy and filtered with lighter filters.
The proxies are structured in a more natural way processing only the necessary data, avoiding the access to synthetic roles as much as possible.
Improvements
Opening the modal:
before - 6sec
after - ~500ms
Closing the modal:
before - 4 sec
after - immediately
Affected areas
SwapModal
SendModal
High regression risk
The regression risk is limited to the token list processing for the token selectors in Swap and Send modals.
Regressions to confirm:
Architecture compliance
My PR is consistent with this document: Status Desktop Architecture Guide
Screen.Recording.2025-01-10.at.09.48.42.mov