-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add support for gzip compression during build and publish #23611
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
Conversation
3.2 shipped with gzip compression during build and publish. During the port to 5.0, the build and publish pipeline was different and ended up only during brotli compression during publish. However, during build the app size is now up to 20MB. Statically compressing runtime assets during build reduces the payload size to about 8.5 MB. This should help with faster initial boot ups and perception.
javiercn
left a comment
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.
I couldn't have written it better!
src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/Wasm/WasmBuildIntegrationTest.cs
Show resolved
Hide resolved
| <!-- | ||
| Compress referenced binaries using GZip during build. This skips files such as the project's assemblies | ||
| that change from build to build. Runtime assets contribute to the bulk of the download size. Compressing it | ||
| has the most benefit while avoiding any ongoing costs to the dev inner loop. |
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.
Does "skip the project's own assemblies" really make the build perceptibly faster? I would have thought that gzipping a few hundred KB (for a fairly large app assembly) would be basically instant.
Not suggesting blocking this PR on that question. I just want to understand.
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.
I thought I had numbers that showed this was going be expensive, but calling GZip on most .NET assemblies, including ones that are several 100kb, seems to be in the order of a few ms. There's a few outliers (like S.T.Encodings takes about 20-30ms for a < 1MB input file), but a few 100kb sized blazor app is a blip.
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.
Filed #23655 so we could consider this.
SteveSandersonMS
left a comment
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.
Super!
3.2 shipped with gzip compression during build and publish. During the port to 5.0, the build and publish
pipeline was different and ended up only porting brotli compression during publish. However, there's concern that people are going to balk at the built app size which is now 20MB. Statically compressing runtime assets during build reduces the payload size to about 8.5 MB.
Before
After