As mentioned in the original single-file issue and in bottom of the single-file design doc, compression is something that is worth taking a look at.
A lot of applications would benefit from smaller executables. Not only is the user experience better as a smaller file means smaller download time, but it also benefits the data transfer costs.
Trimming has helped a lot, and the new .NET 5.0 single-file publish is a great improvement on what we had in .NET Core 3.1. However, a simple Hello World application is still 19 MB as a single-file executable. If I compress it with 7Z LZMA it is 6 MB.
A first step could be to implement deflate compression in the GenerateBundle Msbuild step, and then have the host decompress it in a streaming fashion from the bundle directly. This would incur a small overhead in startup time, so maybe it should have a switch - something like /p:SingleFileCompression=true.
It would be nice to have the compression algorithm pluggable, so if we ever get to have LZMA (see #1542), we can get even better compression ratio.
As mentioned in the original single-file issue and in bottom of the single-file design doc, compression is something that is worth taking a look at.
A lot of applications would benefit from smaller executables. Not only is the user experience better as a smaller file means smaller download time, but it also benefits the data transfer costs.
Trimming has helped a lot, and the new .NET 5.0 single-file publish is a great improvement on what we had in .NET Core 3.1. However, a simple Hello World application is still 19 MB as a single-file executable. If I compress it with 7Z LZMA it is 6 MB.
A first step could be to implement deflate compression in the GenerateBundle Msbuild step, and then have the host decompress it in a streaming fashion from the bundle directly. This would incur a small overhead in startup time, so maybe it should have a switch - something like
/p:SingleFileCompression=true.It would be nice to have the compression algorithm pluggable, so if we ever get to have LZMA (see #1542), we can get even better compression ratio.