qml: improve UI responsiveness during sync - #10750
Open
f321x wants to merge 6 commits into
Open
Conversation
Add a txid -> model row index dict to `QETransactionListModel` instead of re-iterating the `tx_history` list on each event to find the tx item. This noticeably unblocks the UI during sync of a large wallet.
During synchronization, new_transaction fires for every incoming tx and each balanceChanged emit makes QML recompute the balance on the GUI thread. The balance isn't shown anyway during sync.
The addressCoinModel property getter lazily constructs QEAddressCoinListModel, whose __init__ runs a full (slow) initModel(). Instead of initializing it on a new transaction, blocking the UI, just initialize it lazily when the user actually opens it. Same pattern as importAddresses/importPrivateKeys.
Change per-tx event callback logs to debug, might make the process a bit less clogged if there are many txs.
Don't compute the wallet balance delta for the new tx notification shown after synchronizing the wallet if the notification batch exceeds 10 txs. Otherwise the calculation will block the UI, especially for large wallets with many new txs after initial sync.
emit a single dataChanged signal over the whole model index range once in `QETransactionListModel.updateBlockchainHeight()` instead of emitting a separate signal for each transaction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to sync a watch only wallet with this large history address "1K6KoYC69NnafWJ7YgtrpwJxBLiijWqwa6" on Android which was so slow the app became unresponsive after some minutes during the sync.
These commits resolve several inefficiencies and the UI stays fully responsive and manages to finish the sync.