This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Annotate reflection fallback for S.P.DataContractSerialization#31533
Merged
MichalStrehovsky merged 1 commit intodotnet:masterfrom Aug 10, 2018
Merged
Conversation
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.
Member
Author
|
Cc @sergiy-k |
Contributor
|
@dotnet-bot test UWP NETNative x86 Release Build |
mconnew
approved these changes
Aug 9, 2018
MichalStrehovsky
added a commit
to MichalStrehovsky/corefx
that referenced
this pull request
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
pushed a commit
that referenced
this pull request
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.
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
…t/corefx#31533) This adds [removable feature annotation](dotnet/designsdotnet/corefx#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 dotnet/corefx#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. Commit migrated from dotnet/corefx@d21453e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds removable feature annotation 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.