Introduce MathF.CopySign and Math.CopySign micro benchmarks#1298
Introduce MathF.CopySign and Math.CopySign micro benchmarks#1298adamsitnik merged 4 commits intodotnet:masterfrom
Conversation
|
This looks fine to me. @tannergooding any comments? |
| result += MathF.CopySign(result, value); | ||
| } | ||
|
|
||
| if (value != copySignExpectedResult) |
There was a problem hiding this comment.
Shouldn't this be result != copySignExpectedResult?
| for (int iteration = 0; iteration < MathTests.Iterations; iteration++) | ||
| { | ||
| value += copySignDelta; | ||
| result += MathF.CopySign(result, value); |
There was a problem hiding this comment.
It might be good if result started off at some non-zero value.... This is going to subtract result 2500 times and then add it back the next 2500
Otherwise we are just testing adding/subtracting +/-0
|
@billwert, I think it looks fine now. |
|
The The Microbenchmarks.csproj targets older frameworks and because of that the CI fails with following error: @john-h-k could you please extend the following exclusion list with the two new files? performance/src/benchmarks/micro/MicroBenchmarks.csproj Lines 73 to 85 in 78ba20f it should fix the CI error |
For dotnet/runtime#35456
Introduce benchmarks for the CopySign methods, which just test with 2500 iters of sign being 0 and 2500 with sign being 1. Criticism welcome as I am not really sure what i am doing here 😃