-
Notifications
You must be signed in to change notification settings - Fork 272
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 Int128 and CopySign benchmarks #3462
Conversation
|
||
#if NET7_0_OR_GREATER | ||
[Benchmark] | ||
[Arguments(1, -1)] |
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.
Shouldn't this test copying both a positive and negative sign?
The actual code, due to it being two's complement, has different costs based on whether value
is positive or negative and whether sign
is positive or negative.
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.
Shouldn't this test copying both a positive and negative sign?
I tried that and the reported time was almost identical for all test cases (like 0.4 ns for Int16)
namespace System.Tests | ||
{ | ||
[BenchmarkCategory(Categories.Libraries)] | ||
public class Perf_Int128 |
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.
Why only this subset of tests? Do we want to provide meaningful benchmarks for most of Int128/UInt128 since it is not a language primitive, but does provide the full set of functionality?
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.
Why only this subset of tests
My main goal was to add CopySign
benchmarks. I've realized that Int128
has zero benchmarks, so I've copy-pasted Int64
benchmarks and adjusted them. Just to have some benchmarks as a starting point
@cincuranet could you please merge it (the failures are unrelated) |
Done. |
Benchmarks for dotnet/runtime#77579