First round of trimming annotation work#29095
Merged
roji merged 1 commit intodotnet:release/7.0from Sep 15, 2022
Merged
Conversation
To make basic save/query scenarios work with aggressive trimming, as long as user types are properly preserved. Closes dotnet#29092
ajcvickers
approved these changes
Sep 15, 2022
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
To make basic save/query scenarios work with aggressive trimming, as long as user types are properly preserved. This is a conservative/safe wave of annotations that generally avoids risky suppressions; many warnings are still emitted by the linker, but basic scenarios still work. I've kept non-annotation code changes to a minimum, but I did some simple ones were done.
Here are some details and numbers; all scenarios were executed with the modified trimming tests we run in CI.
To summarize, aggressive trimming mode cuts down 1204kb of pure EF size, totalling a 26% reduction in size. Precise per-assembly sizes are listed below.
EF sizes without trimming
EF sizes after aggressive trimming (before this PR)
EF sizes after aggressive trimming (after this PR)
Closes #29092
/cc @DamianEdwards after this, the TrimmedTodo console sample in https://github.com/DamianEdwards/TrimmedTodo works in .NET 7.0 even without specifying partial trimming.