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
🏗 Stop reporting gzipped compressed size in the bundle-size task #24418
🏗 Stop reporting gzipped compressed size in the bundle-size task #24418
Conversation
This is weird. This PR should not change the bundle-size. @rsimha could this be some git/github merge issue? |
Weird indeed. I did a sanity check. The Travis job for this PR uses 2ee0c08 as its baseline (bundle size is 72.18KB). The brotli size for this PR is 72.13KB even though there are zero runtime changes. @jridgewell any way to explain this reduction in brotli size in the absence of runtime code changes? |
Newer brotli installed? |
They're two hours apart... |
863eabe
to
12243e0
Compare
🤷♂️ |
Oh oh... brotli sizes aren't consistent at all - they keep changing between master builds, even when two consecutive builds only change extensions or docs. I should have checked this in advance. I'm going to revert the Bundle-Size bot to use gzip for now, which remains consistent, and investigate tomorrow |
This is unfortunate Paging @erwinmombay, author of |
we're using nodeJS' built in zlib library's zlib.BrotliCompress function and |
I did some experimentation, and it turns out that changing the RTV string in In the example below, we're computing the gzipped and brotli bundle size of I tried passing $ gulp bundle-size --on_local_build
[16:56:26] Using gulpfile ~/src/amphtml/gulpfile.js
[16:56:26] Starting 'bundle-size'...
[16:56:26] Computing bundle size for version 1909102024530 at commit fa43674.
[16:56:26] Running npx bundlesize -f "./dist/v0.js"...
[16:56:31] Bundle size (gzipped) is 84.41KB
[16:56:31] Bundle size (brotli) is 72.09KB
[16:56:31] Finished 'bundle-size' after 4.97 s
$ gulp bundle-size --on_local_build
[16:58:21] Using gulpfile ~/src/amphtml/gulpfile.js
[16:58:21] Starting 'bundle-size'...
[16:58:21] Computing bundle size for version 1909102056380 at commit cc3aa51.
[16:58:21] Running npx bundlesize -f "./dist/v0.js"...
[16:58:25] Bundle size (gzipped) is 84.41KB
[16:58:26] Bundle size (brotli) is 72.14KB
[16:58:26] Finished 'bundle-size' after 4.69 s |
This appears correct to me, the size of the resource should change when the contents shift. If we're looking for an apples - apples comparison, we should inject the same values into the resulting files. |
Chatted offline with @jridgewell and came up with the idea of making a copy of One invariant we can guarantee by doing this is that if the code is the same, the size is the same. @danielrozenberg how easy will it be to retrofit this into |
@alanorozco how close are we to replacing all error strings with Once this is resolved, error strings shouldn't be included in production output. Edit: integer -> numeric |
Good to know. My original point still remains though. For instance, I just discovered that changing a single instance of the number I'm concerned this will be annoying when (if? 😃) we deploy brotli as the default means of verifying bundle size increases. |
This seems like a semi-reasonable idea. There still remains the issue that the real served size will fluctuate because the RTV number will be different in reality, but this check isn't about absolute sizes, it's about relative sizes. I think it shouldn't be a big deal to make this happen, I'll give it a quick attempt today and report back. Other than the RTV, are there any other values that change based on unpredictable factors? Once we start collecting data about extension files as well that could become a relevant question |
Right now, it's just the RTV. Thanks for making the change. |
12243e0
to
8785ba7
Compare
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.
Blocking review so this isn't mistakenly merged. Feel free to dismiss when the time comes 😃
8785ba7
to
e710075
Compare
@danielrozenberg Seems like this is breaking master? https://travis-ci.org/ampproject/amphtml/jobs/592809416#L519 |
Oops, another data migration plan gone wrong... @rsimha can you please
revert this for me and I'll fix it later today?
…On Wed., Oct. 2, 2019, 8:17 p.m. Raghu Simha, ***@***.***> wrote:
@danielrozenberg <https://github.com/danielrozenberg> Seems like this is
breaking master?
https://travis-ci.org/ampproject/amphtml/jobs/592809416#L519
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24418?email_source=notifications&email_token=AAOBE6QM7P2X3QL75ZT4N3LQMU23DA5CNFSM4IVAE4M2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAGSOUI#issuecomment-537732945>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOBE6RPYOWKE7Y774YJXR3QMU23DANCNFSM4IVAE4MQ>
.
|
…size task (ampproject#24418)" (ampproject#24882)" This reverts commit dd23750.
Fixes #21275
Step 3.i. in #21275 (comment)