-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Mitigate JsonObject performance regression. #107944
Mitigate JsonObject performance regression. #107944
Conversation
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonValueOfTPrimitive.cs
Outdated
Show resolved
Hide resolved
How much of the improvement came from this? There are ways to make it safe. |
Not a huge amount. I figured I would rather take the regression for the sake of simplicity. |
/backport to release/9.0 |
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10940503124 |
* Mitigate JsonObject and JsonValue performance regressions. * Revert delayed JsonValueKind derivation.
Makes the following changes:
Makes theJsonValueKind
computation forJsonValue
instances backed by primitives a lazy operation.JsonObject
indexer implementation so that duplicate lookups aren't performed in the common case where a property isn't being overwritten.Should be backported to .NET 9. Fix #107869.
Benchmarks
Using dotnet/performance#4463 on arm64.