First round of trimming annotation work #29095
Merged
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.