• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    C#
  • License
    MIT License
  • Created over 2 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PublishAotCompressed

This is a NuGet package with an MSBuild target to compress results of PublishAot with UPX. Simply add a reference to this package and publish with PublishAot as usual. The result of AOT compilation will be compressed. UPX typically achieves 60% or more size savings. To achieve even more compression at the cost of startup time, specify <PublishLzmaCompressed>true</PublishLzmaCompressed> property as well.

UPX will in-memory decompress the program at launch. This is typically not observable.

A Hello World style program with <UseSystemResourceKeys>true</UseSystemResourceKeys> and <InvariantGlobalization>true</InvariantGlobalization> (two documented size savings options that pretty much everyone should enable) compressed with UPX is around 830 kB in size, fully self-contained. (On Linux, don't forget to also set <StripSymbols>true</StripSymbols>, the documented switch to place debugging symbols into a separate file.)