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

Make serializer settings static #4256

Merged

Conversation

ErikPilsits-RJW
Copy link
Contributor

For System.Text.Json it is imperative to use static serializer options, see https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/configure-options?pivots=dotnet-6-0 . Aside from the performance penalty, the memory and GC pressure is enormous for a high volume client.

I believe Newtonsoft uses a static cache internally so it is not affected by a non-static settings instance, but there is no harm in making the Newtonsoft settings static as well.

This is a breaking change to users with partials that configure these settings. It would be reasonable to wrap the Newtonsoft case in a new UI settings flag, but it is catastrophic for STJ without it and should not be an option.

@RicoSuter
Copy link
Owner

RicoSuter commented Sep 27, 2023

Could you update the branch and fix conflicts?

@RicoSuter
Copy link
Owner

As this will be released with v14, I'd say it's ok to make a breaking change...

@ErikPilsits-RJW
Copy link
Contributor Author

Updated to current master.

@RicoSuter RicoSuter merged commit 11336d6 into RicoSuter:master Sep 28, 2023
1 check failed
lahma pushed a commit to lahma/NSwag that referenced this pull request Jan 20, 2024
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.

None yet

2 participants