-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: Create custom spans for account overview tabs #28086
perf: Create custom spans for account overview tabs #28086
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. |
14aaab4
to
20698f5
Compare
20698f5
to
9e55b3e
Compare
Builds ready [9e55b3e]
Page Load Metrics (1941 ± 66 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
9e55b3e
to
808a0a8
Compare
Builds ready [808a0a8]
Page Load Metrics (2028 ± 177 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
3265b1b
to
15d005c
Compare
Builds ready [15d005c]
Page Load Metrics (2100 ± 172 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
15d005c
to
c734e0a
Compare
Builds ready [c734e0a]
Page Load Metrics (1949 ± 96 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
e5d8844
to
67b9639
Compare
67b9639
to
bae0053
Compare
"Account List Item"
, "Account Overview Tab"
Builds ready [bae0053]
Page Load Metrics (2021 ± 71 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
5f56a80
to
b30323f
Compare
Builds ready [80bdaed]
Page Load Metrics (1813 ± 89 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
I'm not sure about this. Wouldn't this introduce an artificial left-skewedness to the distribution? Discarding all data points where the user navigates away because the current tab takes too long to load might lead to a pretty strong selection effect. On the lower end, the current tab not having finished loading by the time the user is able to click a tab also implies a high floor, so I imagine selectively removing those data points would have a significant effect. An alternative might be capturing aborted load times in a separate data set, but I'm not sure if that's particularly useful to us. Since we're mostly interested in outlier values and the percentiles used to define them, I think aggregating the data might give us better insights (even if our data is essentially a mixture of two distributions that are similar but offset or curtailed). Not 100% on that last point, though. Maybe separating the datasets provides additional insights or is useful in some way that I'm not considering. Edit: Upon discussion..
|
05131aa
to
36b9da1
Compare
…count-overview-tabs` to isolate presentational abstraction away from business logic
3b7255d
to
f3c989b
Compare
Builds ready [3790fc4]
Page Load Metrics (2072 ± 231 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [2718cc4]
Page Load Metrics (1884 ± 103 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@HowardBraham Following up on review feedback:
Restored
How would you feel about splitting this into its own ticket: #28401? Adding these spans is causing e2e failures (https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/110256/workflows/e5f21f65-65da-496f-824a-be04166ff3a4/jobs/4125000/tests) that I'm looking into, but in the meantime it doesn't seem necessary to keep the spans in this PR blocked from going into production. Also, the additional spans aren't strictly necessary to detect the account-watcher performance issue. In contrast, there doesn't seem to be a straightforward way to avoid using a measure that includes resource load time, since the issue appears to cause render delays that are disproportionate to the response times for resource fetch requests. I agree that it's still worth following up with an investigation into whether the performance issue also affects account overview tabs FCP time, since that would provide a metric that is decoupled from resource load bandwidth. I'm not seeing meaningful differences on local, but that could easily change with production data. Documenting a related comment from @Gudahtt:
This requires the ability to add tags to a custom span while calling |
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.
Yeah if a PR doesn't actually break functionality, but just could be better, I'm usually in favor of merging and then improving later.
@@ -84,6 +85,7 @@ export default function NftsTab() { | |||
referrer: ORIGIN_METAMASK, | |||
}, | |||
}); | |||
endTrace({ name: TraceName.AccountOverviewNftsTab }); |
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.
@HowardBraham Had to remove this line as it always triggers when nftsLoading
is set to false, even if the detectNfts
background request is still pending. I'll use this to implement TraceName.AccountOverviewNftsTabFCP
in the PR for additional spans.
endTrace({ name: TraceName.AccountOverviewNftsTab }); |
I added screenshots in the PR description Results section showing that the NftsTab span now captures both performance issues targeted by this ticket.
Builds ready [7eae322]
Page Load Metrics (1925 ± 69 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Motivation
Approach
I've decided to widen the scope of this ticket so that it covers performance issues with all accounts in general (not just those created with the
account-watcher
snap).To this end, I've defined three new custom spans:
'Account Overview - Asset List Tab'
'Account Overview - Nfts Tab'
'Account Overview - Activity Tab'
Behavior
"Account Overview - Asset List Tab"
) the "Import" button in the detected token selection popover is clicked.Helpers
defaultHomeActiveTabName
property of themetamask
slice.AccountOverviewTabKey
and objectsACCOUNT_OVERVIEW_TAB_KEY_TO_METAMETRICS_EVENT_NAME_MAP
,ACCOUNT_OVERVIEW_TAB_KEY_TO_TRACE_NAME_MAP
.Results
The custom spans function as expected.
The custom spans capture the performance issues that motivated this ticket
NftsTab
component,account-watcher
snap - Switching from a whale account's NFTs tab to a different account causes significant lag #28130 (see 1.28m long Nfts Tab span and Error message: "Cannot destructure property 'imageOriginal' ...")Related issues
Manual testing steps
Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist