Skip to content
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

Update System.IO.Compression to use the best compression. #9838

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dellis1972
Copy link
Contributor

`System.IO.Compression`` uses the default compression level which is not the Smallest compression level. This change updates the compression level to the best compression level since the size of the Apk is very important.

Unfortunately, the SmallestSize compression enum level is not available on netstandard2.0. So we have to use a cast to get it to work.

`System.IO.Compression`` uses the default compression level which is not
the best compression level. This change updates the compression
level to the best compression level since the size of the Apk is
very important.

Unfortunately, the best compression enum level is not available on `netstandard2.0`.
So we have to use a cast to get it to work.
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

We may want this one to actually test System.IO.Compression in main:

@jonathanpeppers
Copy link
Member

Should we make an MSBuild property to toggle the enum?

Then we could consider debug mode using a "fast" compression and Release doing a "slow" but small compression?

@jpobst
Copy link
Contributor

jpobst commented Feb 26, 2025

We should probably have performance data on this to understand the tradeoffs. For a Debug build compression time is probably more important than compression size.

Also, the Release aab is going to be recompressed by Google so a few percent probably doesn't matter there either, but if it's significant then it might be useful.

Archive size differences between LibZipSharp and SIC are available on #9623.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants