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

Use native AOT toolchain to reduce binary size #13

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

Conversation

JasonWei512
Copy link

Replace ReadToRun with native AOT compiler to reduce binary size.

Before After Smaller
Binary Size 14.4 MB 4.2 MB 70%
Memory Usage 4.0 MB 1.4 MB 65%

Tested on both GitHub Actions and Azure Pipelines.

Works with features/config branch where System.Text.Json is used, which uses reflection.

Build requirements:

  • Windows SDK
  • Microsoft.VisualStudio.Component.VC.Tools.x86.x64
  • Microsoft.VisualStudio.Component.VC.Tools.ARM64

Build commands:

dotnet publish -c Release -r win-x64 --self-contained true
dotnet publish -c Release -r win-arm64 --self-contained true

@LifeIsStrange
Copy link

Same comment as for the other PR:
AOT has lower throughput and energy efficiency than JIT. Therefore it should not be the default user experience.
Can make sense for people that have extremely small disk space though but very niche.

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.

2 participants