-
Notifications
You must be signed in to change notification settings - Fork 274
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
Add Utf8JsonReader.GetBoolean() benchmark #2139
Conversation
@@ -23,214 +25,189 @@ private static byte[] GetJsonBytes<T>(T elem) | |||
return Encoding.UTF8.GetBytes(elem.ToString()); | |||
} | |||
|
|||
[Benchmark] | |||
public byte GetByte() | |||
[Benchmark(OperationsPerInvoke = OperationsPerBenchmark)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the benefit of using OperationsPerInvoke
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eiriktsarpalis thank you for your contribution! Please see my comments for full details.
@@ -23,214 +25,189 @@ private static byte[] GetJsonBytes<T>(T elem) | |||
return Encoding.UTF8.GetBytes(elem.ToString()); | |||
} | |||
|
|||
[Benchmark] | |||
public byte GetByte() | |||
[Benchmark(OperationsPerInvoke = OperationsPerBenchmark)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/benchmarks/micro/libraries/System.Text.Json/Utf8JsonReader/Perf.Get.cs
Outdated
Show resolved
Hide resolved
src/benchmarks/micro/libraries/System.Text.Json/Utf8JsonReader/Perf.Get.cs
Outdated
Show resolved
Hide resolved
src/benchmarks/micro/libraries/System.Text.Json/Utf8JsonReader/Perf.Get.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @eiriktsarpalis !
Add a
GetBoolean()
benchmark and simplify existing benchmarks in the same class. Used by dotnet/runtime#61746.