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

Refactor default converter registration to allow trimming when converters not used #427

Merged
merged 1 commit into from
Dec 6, 2020

Conversation

layomia
Copy link

@layomia layomia commented Dec 6, 2020

Partly addresses https://github.com/dotnet/runtimelab/projects/1#card-49468644 and dotnet/runtime#45441.

App itself is not trimmed per expectations for .NET 6.

Changes optimized for the console app scenario.

TODO (in follow up):

  • PR to address the Blazor app scenario is upcoming (needs changes to System.Net.Http.Json.dll and perhaps other changes).
  • CI tests to catch size regressions to app and/or System.Text.Json
  • PR/design to allow trimming of unused reflection code-paths (Reflection[Emit]MemberAccessor).

Console App

Pre-trimmed STJ.dll (KB) Trimmed STJ.dll (KB) Pre-trimmed App (MB) Trimmed App (MB) Pre-trimmed Application .dll (KB) Trimmed Application .dll (KB)
.NET 5 - S.T.J OOB (Before this change) 349 252 64.5 17.3 7 7
.NET 5 - S.T.J OOB (After this change) 347 170 64.5 17 7 7

Blazor App

Pre-trimmed STJ.dll (KB) Trimmed STJ.dll (KB) Pre-trimmed App (MB) Trimmed App (MB) Pre-trimmed Application .dll (KB) Trimmed Application .dll (KB)
.NET 5 - S.T.J OOB (Before this change) 349 243 17.8 2.41 20 20
.NET 5 - S.T.J OOB (After this change) 347 243 17.8 2.41 20 20

@layomia layomia self-assigned this Dec 6, 2020
@layomia layomia merged commit f2da9a6 into dotnet:feature/JsonCodeGen Dec 6, 2020
safern pushed a commit that referenced this pull request Feb 3, 2021
@layomia layomia deleted the ConverterRegistration branch March 29, 2021 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant