-
Notifications
You must be signed in to change notification settings - Fork 559
Update System.IO.Compression to use the best compression. #9838
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
`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.
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.
We may want this one to actually test System.IO.Compression in main:
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? |
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 Archive size differences between |
Were there specific apps you got the differences in #9623 on? I should probably do the same ones |
We do need to consider upload size for aab as well. A smaller package means less bandwidth, people do still pay for data. |
Do we want or need this? As-is? Is this codepath even used? For example, we know that right now System.IO.Compression is broken for us; see also dotnet/runtime#113306 Given that, why were the PR checks green? This suggests that we're not using System.IO.Compression right now. (See also: 7454deb, f3ef4fe.) I'm not sure what we should do with this PR right now. |
Using an existing quick and dirty test I already had that simulates adding all our assemblies to a
(Tested on .NET 9) This appears to take more than double the compression time for 2-3% smaller zip files. |
That might be worth it, depending on "Fastest" might be best. |
I'm gonna close this. Looks like we need a way to configure this from the users perspective. So that for debug we use fastest but for release we use max or optimal. |
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.