Fix SpanBench#9783
Conversation
Make benchmark class public, add namespace. Tweak iteration counts to very roughly 1 second per xunit-perf iteration.
|
@joperezr @ahsonkhan PTAL Resolves the ongoing mystery of why this benchmark hasn't been producing perf results: when I originally wrote it I did not make the benchmark class public. Local testing using run-xunit-perf shows reasonable results now. |
| namespace Span | ||
| { | ||
|
|
||
| public class Tests |
There was a problem hiding this comment.
Can you rename this from Tests to something like SpanBench (or more descriptive and unique). Makes it easier to search, especially in benchview.
|
Looks good to me :) |
|
Meant to ping @jorive.... |
|
@AndyAyersMS Changes look good. Optionally, you could change the benchmarks inner iterations to look more like this: As-is, the results will display on BenchView like this: |
|
The final This test can be run as a perf test two ways -- under xunit perf and also as a standalone exe. I generally haven't generally used inner iteration count for the tests I write to maintain symmetry with the exe-driven portion of the testing. Happy to change the class name to |
|
@AndyAyersMS, I think SpanBench is fine. There is already a method: static double Bench(Action f)error CS0542: 'Bench': member names cannot be the same as their enclosing type [D:\j\workspace\debug_windows---17180f1b\tests\src\JIT\Performance\CodeQuality\Span\SpanBench.csproj] |
|
@AndyAyersMS, you probably don't want to name your class "Benchmark" SpanBench.cs(203,45): error CS0117: 'Benchmark' does not contain a definition for 'Iterations' [D:\j\workspace\checked_windo---f6dc6fe4\tests\src\JIT\Performance\CodeQuality\Span\SpanBench.csproj] It gets confused with Benchmark attribute for the performance tests. foreach (var iteration in Benchmark.Iterations) |
|
Odd that I don't see any of these errors building locally... anyways, back to SpanBench it is. |
|
Arm emulator build failure, seems widespread since roughly midnight. looks like this artifact comes from a corefx build, last good run has: Root cause is likely this change which broke arm builds in CoreFX: |
|
@ahsonkhan I'll abandon this since your #9790 has incorporated these changes already. |
|
@dotnet-bot test Linux ARM Emulator Cross Release Build |
Sounds good. Close this PR? |
Make benchmark class public, add namespace. Tweak iteration counts
to very roughly 1 second per xunit-perf iteration.