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

[.NET 6] Enable the sealer optimization in the linker #9573

Closed
Tracked by #43078
rolfbjarne opened this issue Sep 2, 2020 · 0 comments · Fixed by #12009
Closed
Tracked by #43078

[.NET 6] Enable the sealer optimization in the linker #9573

rolfbjarne opened this issue Sep 2, 2020 · 0 comments · Fixed by #12009
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri2 .NET 6: want to have for stable release enhancement The issue or pull request is an enhancement estimate-2d iOS Issues affecting iOS
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Sep 2, 2020

As the description says: enable the sealer optimization in the linker.

The difficult part lies in the fact that the only way to enable the sealer optimization is to pass the --enable-opt sealer command-line argument to the linker, and we currently have most of the logic to determine whether the sealer substep should be enabled or not in our custom linker steps.

A couple of options:

  • Move much of the logic to determine if the sealer substep should be enabled out of the custom linker steps and into msbuild tasks that execute before we execute the linker. Doing this while at the same time not duplicating a lot of code is somewhat tricky, since we still need to code inside our custom linker steps.
  • Ask the linker to make it possible to enable optimizations from our custom linker steps.

Ref: #9575

@rolfbjarne rolfbjarne added enhancement The issue or pull request is an enhancement iOS Issues affecting iOS labels Sep 2, 2020
@rolfbjarne rolfbjarne modified the milestones: Future, .NET 6 Sep 2, 2020
@rolfbjarne rolfbjarne added the dotnet An issue or pull request related to .NET (6) label Sep 10, 2020
@rolfbjarne rolfbjarne added dotnet-pri2 .NET 6: want to have for stable release estimate-2d labels Feb 3, 2021
spouliot pushed a commit to spouliot/xamarin-macios that referenced this issue Jun 23, 2021
when (by default)
* the interpreter is not enabled (since new code might subclass or override the members analyzed at build time)
* building for release

Reverts xamarin@c56b893
Fix xamarin#9573

Work-in-progress:
* should be made easier to enable/disable (from user projects)
* the above conditions should be the default (if nothing is specified)
spouliot added a commit that referenced this issue Aug 10, 2021
when (by default)
* the interpreter is not enabled (since new code might subclass or override the members analyzed at build time)
* building for release

Reverts c56b893
Fix #9573

Notes

* Even if possible (in metadata) there is no point in setting `final` on
a method if we remove `virtual`. This match ILLink version of the sealer
and makes the same test pass on both.

* Don't apply optimization on non-AOT builds, e.g. simulators, since some
features (like XML serialization) checks for
`RuntimeFeature.IsDynamicCodeSupported` and that requires some types
to be subclassed thru SRE
@ghost ghost locked as resolved and limited conversation to collaborators Apr 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri2 .NET 6: want to have for stable release enhancement The issue or pull request is an enhancement estimate-2d iOS Issues affecting iOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant