-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
chore: Optimize performance of Assets hooks #30872
base: main
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
}; | ||
const mergedCrossChainRates: Balances = useMemo( | ||
() => ({ | ||
...crossChainContractRates, // todo add confirmation exchange rates? |
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.
Do we even need to do this? Is the todo
relevant?
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.
If we can confirm that this has a ticket, I'm down to remove this TODO comment.
// to sort by fiat balance, we need to compute this at this level | ||
const tokenExchangeRate = mergedRates[toChecksumAddress(token.address)]; | ||
token.tokenFiatAmount = | ||
getTokenFiatAmount( |
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.
Nice work memoizing all of these!
When I did some investigating, I saw that this function uses an internal class Numeric
. This has very high GC rate (since it keeps creating new objects).
^ Just noting this, we don't need to tackle GCs yet.
Builds ready [816e74e]
Page Load Metrics (2022 ± 141 ms)
Bundle size diffs
|
Memoizes much of the work in the
useAccountTotalCrossChainFiatBalance
anduseAccountTotalFiatBalance
hooksDescription
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist