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

Introducing .NET IL Linker #30

Open
richlander opened this Issue Aug 30, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@richlander
Member

richlander commented Aug 30, 2017

Introducing .NET IL Linker

The .NET Core team has been working on a linker in collaboration with the Mono team. It is based on the Mono Linker project, and by extension, on the Cecil project.

The goal of the .NET IL Linker project is two part:

  • Provide a capable linker for .NET Core to make it easy to significantly reduce .NET Core application sizes.
  • Establish the Mono Linker as the primary linker for the .NET ecosystem.

You can start using the linker today, using the following instructions:

Discussion

Please share your thoughts on this change and see what others are saying at:

Details

In trivial cases, the linker can reduce the size of applications by 50%. The size wins may be more favorable or more moderate for larger applications. The linker removes code in your application and dependent libraries that are not reached by any code paths. It is effectively an application-specific dead code analysis.

The IL Linker currently only supports .NET Core Self Contained Applications with this first preview version. You can try using the linker with an example self-contained .NET Core application sample. The primary difference with this application is that it has a reference to the ILLink.Tasks package in its cspoj project file.

The Linker provides an option to print a size improvement chart that describes binaries that have been removed from an application or that have been reduced in size. It also provides the total % size reduction for the application. You can see an example of one of these charts in the following example.

.NET IL Linker Size Improvement Chart

Please provide feedback on your use of the linker. We are actively looking for feedback to improve the linker. In particular, we are looking for feedback on the following topics:

  • Linker throughput.
  • Cases where the linker can be more aggressive.
  • Cases where the link is too aggressive and causes applications to fail at runtime.
  • The linker provided an excellent result for a large application.

Please create issue with your feedback at either mono/linker or dotnet/core. Also feel free to contact the team at clrlinker@microsoft.com.

And, it wouldn't be right to announce this linker without a hat tip to Joel Spolsky who we can give the honorary and historical distinction of feature requestor.

@dotnet dotnet locked and limited conversation to collaborators Aug 30, 2017

@terrajobst terrajobst closed this Nov 8, 2017

@terrajobst

This comment has been minimized.

Show comment
Hide comment
@terrajobst

terrajobst Nov 10, 2017

Member

Reopening according to process.

Member

terrajobst commented Nov 10, 2017

Reopening according to process.

@terrajobst terrajobst reopened this Nov 10, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.