Speedup fetching of token balances in Swap #28634
Labels
feature/web3/wallet/swap
feature/web3/wallet
Integrating Ethereum+ wallet support
OS/Desktop
perf
QA Pass-Win64
QA/Yes
release-notes/include
Milestone
Currently Swap suffers from a performance issue that's unique to it since we fetch balances for the entire tokens list, instead of just the visible assets list. This results in hundreds of mojo calls, which we can potentially cut down to a single one using the new
GetERC20TokenBalances
mojo method.We can expect a speedup of 3x-10x, depending on the size of the tokens list. Following this improvement, we can also periodically refresh the balances without incurring a heavy cost.
The text was updated successfully, but these errors were encountered: