Skip to content

Conversation

@pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Jul 2, 2020

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

image

After

image

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.
@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Jul 2, 2020
@pranavkm pranavkm requested a review from a team July 2, 2020 14:23
@pranavkm pranavkm added the area-blazor Includes: Blazor, Razor Components label Jul 2, 2020
Copy link
Member

@javiercn javiercn left a 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!

@mkArtakMSFT mkArtakMSFT added the ask-mode This issue / PR is a patch candidate which we will bar-check internally before patching it. label Jul 2, 2020
@mkArtakMSFT mkArtakMSFT added this to the 5.0.0-preview7 milestone Jul 2, 2020
@Pilchie Pilchie added the Servicing-approved Shiproom has approved the issue label Jul 2, 2020
<!--
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.
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super!

@mkArtakMSFT mkArtakMSFT merged commit 499a3bc into release/5.0-preview7 Jul 4, 2020
@mkArtakMSFT mkArtakMSFT deleted the prkrishn/gzip branch July 4, 2020 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates ask-mode This issue / PR is a patch candidate which we will bar-check internally before patching it. Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants