-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(duplicated-javascript): display as transfer size #10701
Conversation
side note: @patrickhulce think this should be named |
🤷 eh I agree |
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.
most of this depends on the resolution to my first question about sourceSize actually being transfer size :)
@@ -85,156 +85,86 @@ describe('DuplicatedJavascript computed artifact', () => { | |||
Object { | |||
"source": "Control/assets/js/vendor/ng/select/select.js", | |||
"sourceBytes": Array [ | |||
48513, | |||
48513, | |||
16009, |
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.
hm this feels weird to say that the sourceBytes
are transferSize, no?
I agree with wasted computations using transferSize, that seems great 👍 (based on what was happening with wastedBytesByUrl
I assumed they already were, and looks like that was half true and we were only using that for the opportunity savings and not the displayed wasted bytes?)
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.
hm this feels weird to say that the sourceBytes are transferSize, no?
sourceTransferBytes
? I'm wondering if in the long run we'd want to modify the bytes type: {transfer: ..., resource: ...}
.
based on what was happening with wastedBytesByUrl I assumed they already were, and looks like that was half true and we were only using that for the opportunity savings and not the displayed wasted bytes
yea, that map is only for the base class to calculate savings in latern. only showed up as the seconds savings estimate in the report.
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.
sourceTransferBytes sgtm 👍
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.
actually, given that wastedBytes
and totalBytes
on all opportunities are in terms of transfer size, I'm hesitant to break consistency in naming here. We don't specify transfer or resource bytes in any of our byte keys.
why does it feel weird?
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.
it feels weird here because we're specifically talking about the source code, unlike in all the other opportunities that are always talking about what was transferred. the introduction of source map data changes the game IMO because there's a completely new size we could be talking about, the original source code size. Calling something sourceSize
makes me think it's the size of that original source code rather than the bytes that were transferred corresponding to a subset of that source code.
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.
sorry for the delay here @connorjclark I think this wound up mislabeled. were you waiting on me for anything else?
@@ -85,156 +85,86 @@ describe('DuplicatedJavascript computed artifact', () => { | |||
Object { | |||
"source": "Control/assets/js/vendor/ng/select/select.js", | |||
"sourceBytes": Array [ | |||
48513, | |||
48513, | |||
16009, |
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.
sourceTransferBytes sgtm 👍
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.
LGTM other than the test changes that feel like something is off.
I'm guessing some of our "should never happen cases" are actually happening, because now we drop the subitem instead of just not getting the savings in lantern estimate
"wastedBytes": 4410, | ||
}, | ||
Object { | ||
"source": "js/src/utils/service/amplitude-service.ts", |
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.
feels weird that so many of these disappeared, are they really being compressed that well they fall below 200 bytes?
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.
The estimated transfer size for this source is 1022, which is still above the 200 sub-item threshold.
It's elided because the per-item threshold is 1024 :)
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.
Lowered the threshold for this test.
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.
oooooh the changed threshold wasn't for this test, gotcha gotcha, sorry for the noise :)
}, | ||
"totalBytes": 0, | ||
"url": "", | ||
"wastedBytes": 3098, |
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.
like this one supposedly went from 3000+ bytes wasted to <200 bytes wasted?
in #10700 Patrick suggested I refactor the
sizes
here too. I realized that the table was mistakenly showing resource sizes.The opportunity savings estimate is from the
wastedBytesByUrl
map, which was correctly using transfer size, so estimated savings won't change.