I want to use BenchmarkDotNet to run benchmarks on all three Run()
methods of the following classes. But it's not clear what the syntax should be.
class Class1
{
[Benchmark]
public bool Run(ref string[] columns)
{
// ...
}
}
class Class2
{
[Benchmark]
public bool Run(ref string[] columns)
{
// ...
}
}
class Class3
{
[Benchmark]
public bool Run(ref string[] columns)
{
// ...
}
}
I tried syntax like this.
BenchmarkRunner.Run<Class1>();
But this gives me an error.
Benchmark method ReadRow has incorrect signature.
Method shouldn't have any arguments.
Questions: To compare the performance of these three methods:
- How do I satisfy the argument requirements and eliminate this error?
- How do I compare the performance of the methods? Do I simply call
BenchmarkRunner.Run<Class1>()
for each class, sequentially?