[System.Text.Json] Move inline throw statements to ThrowHelper#61746
Merged
eiriktsarpalis merged 5 commits intodotnet:mainfrom Nov 23, 2021
Merged
[System.Text.Json] Move inline throw statements to ThrowHelper#61746eiriktsarpalis merged 5 commits intodotnet:mainfrom
ThrowHelper#61746eiriktsarpalis merged 5 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-text-json Issue DetailsReplaces a number of occurrences of While .NET 6 codegen around exception throwing appears to have improved, I'm still seeing modest performance improvements in microbenchmarks, particularly around the Fix #59378.
|
jkotas
reviewed
Nov 18, 2021
src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Nov 18, 2021
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Nov 18, 2021
src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.TryGet.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Nov 18, 2021
src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.TryGet.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Nov 18, 2021
src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.cs
Outdated
Show resolved
Hide resolved
Member
Author
|
FWIW here are results comparing the BenchmarkDotNet=v0.13.1.1616-nightly, OS=Windows 10.0.22000
Intel Core i9-10900X CPU 3.70GHz, 1 CPU, 20 logical and 10 physical cores
.NET SDK=7.0.100-alpha.1.21566.20
[Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
Job-FUQUAC : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT
Job-YDOZOU : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT
PowerPlanMode=00000000-0000-0000-0000-000000000000 Arguments=/p:DebugType=portable,-bl:benchmarkdotnet.binlog IterationTime=250.0000 ms
MaxIterationCount=20 MinIterationCount=15 WarmupCount=1
|
steveharter
reviewed
Nov 22, 2021
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs
Outdated
Show resolved
Hide resolved
steveharter
reviewed
Nov 22, 2021
src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.TryGet.cs
Outdated
Show resolved
Hide resolved
steveharter
approved these changes
Nov 22, 2021
aae0d90 to
791ec4e
Compare
This was referenced Nov 29, 2021
This was referenced Nov 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Replaces a number of occurrences of
throw ThrowHelper.GetException();statements found in System.Text.Json withThrowHelper.ThrowException();method calls.While .NET 6 codegen around exception throwing appears to have improved, I'm still seeing modest performance improvements in microbenchmarks, particularly around the
Utf8JsonReader.Get*()methods, which are relatively small methods that inlinethrowstatements.Fix #59378.