Uh oh!
There was an error while loading. Please reload this page.
[release/7.0] Fix performance regression in STJ JsonNode instantiations - #78147
Conversation
ghost
commented
Nov 10, 2022
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsBackport of #78130 to release/7.0 /cc @eiriktsarpalis@stephentoub Customer ImpactTestingRiskIMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.
|
eiriktsarpalis
commented
Nov 10, 2022
@carlossanlop do we need to increment the servicing version for this change? It's already been incremented as part of #77388. |
ericstj
commented
Nov 10, 2022
Is there any risk that this is now static? Are they mutable and would changes made by one instance now effect others when they didn't before? |
eiriktsarpalis
commented
Nov 10, 2022
No such risk. The value is used as the default |
ericstj
commented
Nov 10, 2022
I see. Perhaps in |
eiriktsarpalis
commented
Nov 10, 2022
Yes we could definitely make that change to avoid potential leaks of the value in the future. |
eiriktsarpalis
commented
Nov 11, 2022
Servicing approved over email. |
carlossanlop
commented
Nov 11, 2022
Now we only need a code review sign-off. @eiriktsarpalis or @layomia or @ericstj. |
Approved by Tactics and signed-off by area owner. runtime/src/libraries/System.Text.Json/src/System.Text.Json.csproj Lines 10 to 12 in 9e7c283 Ready to merge. |
Backport of #78130 to release/7.0
/cc @eiriktsarpalis@stephentoub
Customer Impact
Fixes a customer reported performance regression when creating
JsonNodeinstances. This was caused by a static field in the class not having included thestatickeyword, resulting in expensive initializations on everyJsonNodeinstantiation. According to benchmarks, this has resulted in said instantiation being 7x slower compared to .NET 6.Testing
Added benchmarks to dotnet/performance measuring performance of
JsonNode.Risk
Low. Adds a missing
statickeyword to a readonly field declaration.