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

[release/6.0.2xx] Add a custom flag to disable marking of copy assemblies #2437

Merged

Conversation

vitek-karas
Copy link
Member

@vitek-karas vitek-karas commented Dec 10, 2021

This is a release/6.0.2xx port of #2370

Enabled by --custom-data DisableMarkingOfCopyAssemblies=true on the command line. Assumes that ALL assemblies on the input are in "copy" action (it doesn't validate this fact).

It disables marking basically fully - linker will go over all assemblies, and process them in "copy" mode (copy the original file over) and will call all the custom steps and so on, but it will do no marking (or very little, depends on descriptors and such which this doesn't disable).

This is intentionally non-discoverable feature, to be used only by the mono AOT toolchain.

Fixes #2089.

Customer impact

Xamarin "notrim" mode (used in AOT scenarios for debug builds for example) regressed with .NET 6 trimmer. The trimmer used to run quickly (several seconds), now it's much slower (5x slower roughly, sometimes worse). The change allows Xamarin SDK to tell the trimmer to avoid doing most of the expensive work as it won't be trimming anything. The speedup is very visible: Hello world app build went from 19s to 7s.

Testing

Validated with Xamarin that the change fixes the problem.

Risk

Low - added new command line option specifically to be used by Xamarin. Undocumented, not to be used by anything else.

Enabled by `--custom-data DisableMarkingOfCopyAssemblies=true` on the command line. Assumes that ALL assemblies on the input are in "copy" action (it doesn't validate this fact).

It disables marking basically fully - linker will go over all assemblies, and process them in "copy" mode (copy the original file over) and will call all the custom steps and so on, but it will do no marking (or very little, depends on descriptors and such which this doesn't disable).

This is intentionally non-discoverable feature, to be used only by the mono AOT toolchain.
Copy link
Member

@agocke agocke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, approved in email

@agocke agocke merged commit e28b7f3 into dotnet:release/6.0.2xx Jan 6, 2022
@vitek-karas vitek-karas deleted the DisableMarkingOfCopyAssemblies6 branch January 7, 2022 10:48
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
…r#2370) (dotnet/linker#2437)

Enabled by `--custom-data DisableMarkingOfCopyAssemblies=true` on the command line. Assumes that ALL assemblies on the input are in "copy" action (it doesn't validate this fact).

It disables marking basically fully - linker will go over all assemblies, and process them in "copy" mode (copy the original file over) and will call all the custom steps and so on, but it will do no marking (or very little, depends on descriptors and such which this doesn't disable).

This is intentionally non-discoverable feature, to be used only by the mono AOT toolchain.

Commit migrated from dotnet/linker@e28b7f3
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.

3 participants