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

UWP 6.2 size on disk optimizations #26575

Closed
22 of 24 tasks
MichalStrehovsky opened this issue Jun 22, 2018 · 1 comment
Closed
22 of 24 tasks

UWP 6.2 size on disk optimizations #26575

MichalStrehovsky opened this issue Jun 22, 2018 · 1 comment
Milestone

Comments

@MichalStrehovsky
Copy link
Member

This is a running list of size on disk optimizations we're planning for UWP 6.2 to meet size on disk footprint targets set by the Windows team in a post-NetStandard 2.0 world.

Removable feature annotations:

.NET Native compiler work (for completeness):

  • Respect removable feature annotations in the Dependency Reducer
    • Expose option to specify removable features from project files/AppCompile
  • Add option to strip framework exception messages (400 kB size on disk saving)
    • Expose option to strip framework exception messages from project files/AppCompile
    • Make option to strip framework exception messages also respected on ARM64
  • Expose option to strip stack trace metadata from project files/AppCompile
  • Expose option to optimize for size from project files/AppCompile
  • Make the generic composition data that hangs off EETypes RVA-sized (instead of pointer-sized). (110 kB size on disk saving)
  • Add option to relax method body alignment requirement (1.5% size on disk saving)
    • Expose option to relax method body alignment from project files/AppCompile
  • Add option to disable generation of dynamic invoke thunks (2% size on disk saving)
    • Expose from project files/AppCompile
@MichalStrehovsky
Copy link
Member Author

Cc @sergiy-k

MichalStrehovsky referenced this issue in MichalStrehovsky/corefx Jul 31, 2018
This adds [removable feature annotation](dotnet/designs#42) to `XmlDownloadManager`.

If the user specifies that they would like to remove support for this at publish/native compilation time, the linker/compiler is going to replace the method body of `CreateWebRequestOrThrowIfRemoved` with a throwing method body. The exception message is going to inform the user that the feature has been removed because they opted into the removal.

Contributes to #30597. Saves 1.2 MB of the size of the Windows UWP People app. This is a size on disk regression that came with NetStandard 2.0.
MichalStrehovsky referenced this issue in dotnet/corefx Jul 31, 2018
This adds [removable feature annotation](dotnet/designs#42) to `XmlDownloadManager`.

If the user specifies that they would like to remove support for this at publish/native compilation time, the linker/compiler is going to replace the method body of `CreateWebRequestOrThrowIfRemoved` with a throwing method body. The exception message is going to inform the user that the feature has been removed because they opted into the removal.

Contributes to #30597. Saves 1.2 MB of the size of the Windows UWP People app. This is a size on disk regression that came with NetStandard 2.0.
MichalStrehovsky referenced this issue in MichalStrehovsky/corefx Aug 1, 2018
This adds [removable feature annotation](dotnet/designs#42) to data
contract serialization.

If the user specifies that they would like to remove support for this
at publish/native compilation time, the linker/compiler is going to
replace the annotated method bodies with a throwing method body.
The exception message is going to inform the user that the feature
has been removed because they opted into the removal. The throwing
method body is significantly smaller than the transitive closure
of code reachable from the original method body.

Contributes to #30597. Turning this feature off in the UWP People app
saves 4% of size. This is a size on disk regression that came with
the new version of CoreFX and blocks the Windows team in picking up
the latest framework. There is a zero size growth goal.
MichalStrehovsky referenced this issue in dotnet/corefx Aug 10, 2018
This adds [removable feature annotation](dotnet/designs#42) to data
contract serialization.

If the user specifies that they would like to remove support for this
at publish/native compilation time, the linker/compiler is going to
replace the annotated method bodies with a throwing method body.
The exception message is going to inform the user that the feature
has been removed because they opted into the removal. The throwing
method body is significantly smaller than the transitive closure
of code reachable from the original method body.

Contributes to #30597. Turning this feature off in the UWP People app
saves 4% of size. This is a size on disk regression that came with
the new version of CoreFX and blocks the Windows team in picking up
the latest framework. There is a zero size growth goal.
MichalStrehovsky referenced this issue in MichalStrehovsky/corefx Aug 10, 2018
This adds [removable feature annotation](dotnet/designs#42) to `XmlDownloadManager`.

If the user specifies that they would like to remove support for this at publish/native compilation time, the linker/compiler is going to replace the method body of `CreateWebRequestOrThrowIfRemoved` with a throwing method body. The exception message is going to inform the user that the feature has been removed because they opted into the removal.

Contributes to #30597. Saves 1.2 MB of the size of the Windows UWP People app. This is a size on disk regression that came with NetStandard 2.0.
MichalStrehovsky referenced this issue in MichalStrehovsky/corefx Aug 10, 2018
…t#31533)

This adds [removable feature annotation](dotnet/designs#42) to data
contract serialization.

If the user specifies that they would like to remove support for this
at publish/native compilation time, the linker/compiler is going to
replace the annotated method bodies with a throwing method body.
The exception message is going to inform the user that the feature
has been removed because they opted into the removal. The throwing
method body is significantly smaller than the transitive closure
of code reachable from the original method body.

Contributes to #30597. Turning this feature off in the UWP People app
saves 4% of size. This is a size on disk regression that came with
the new version of CoreFX and blocks the Windows team in picking up
the latest framework. There is a zero size growth goal.
zacharycmontoya referenced this issue in dotnet/corefx Aug 17, 2018
* Fix RD.XML for System.Private.Xml (#31125)

This corrects the size on disk regression caused by #19912. After that pull request, all of the schema validation stuff would always be included for any app that depends on System.Private.Xml because during initial analysis we consider a lot of things in S.P.Xml necessary as a precaution for SG generating references to it. The RD.XML in S.P.Xml then roots things forever.

I spent some time getting a repro of the original failure and convinced myself this is not a scenario that would require RD.XML in the S.P.Xml assembly.

Here's the facts:
* This test uses a test hook to explicitly disable pregenerated serialization code for `XmlSchema`. (https://github.com/dotnet/corefx/blob/1afc5360013bedc4099875c836342f493b083e5f/src/System.Private.Xml/src/System/Xml/Schema/XmlSchema.cs#L175 that is on stack at the time of failure is an analysis slam dunk, so we do have pregenerated code, we just don't use it because of the hook)
* The test is then testing the reflection fallback path to serialize `XmlSchema`. This doesn't work. Reflection fallback path won't in general work for _any framework provided type_ because there's no RD.XML to root it. Reflection fallback really only works for user types because of our default RD.XML that roots all user types (we also use that for the CoreFX tests, which is why the other reflection fallback tests don't hit issues).

* Add RemovableFeatureAttribute

* Make non-file URL support optional in XmlUrlResolver

This adds [removable feature annotation](dotnet/designs#42) to `XmlDownloadManager`.

If the user specifies that they would like to remove support for this at publish/native compilation time, the linker/compiler is going to replace the method body of `CreateWebRequestOrThrowIfRemoved` with a throwing method body. The exception message is going to inform the user that the feature has been removed because they opted into the removal.

Contributes to #30597. Saves 1.2 MB of the size of the Windows UWP People app. This is a size on disk regression that came with NetStandard 2.0.

* Annotate reflection fallback for S.P.DataContractSerialization (#31533)

This adds [removable feature annotation](dotnet/designs#42) to data
contract serialization.

If the user specifies that they would like to remove support for this
at publish/native compilation time, the linker/compiler is going to
replace the annotated method bodies with a throwing method body.
The exception message is going to inform the user that the feature
has been removed because they opted into the removal. The throwing
method body is significantly smaller than the transitive closure
of code reachable from the original method body.

Contributes to #30597. Turning this feature off in the UWP People app
saves 4% of size. This is a size on disk regression that came with
the new version of CoreFX and blocks the Windows team in picking up
the latest framework. There is a zero size growth goal.

* Sync SR class with the CoreRT copy

This ports over the change from
dotnet/corert@0ac83cb.

When UsingResourceKeys is true and we stripped the resources, the
existing code would have returned null.
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the UWP6.1 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants