dotnet / dotnet/BenchmarkDotNet
Fluent API improvements
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 1.1k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 11
Description
In my benchmark project I developed a small framework to improve fluent configuration of benchmarks. With this improvements I can configure benchmark like this
```c#
var pointHitTestJob = CreateJob();
var pointHitTestRunInfo = BenchmarkRunInfoBuilder
.Create()
.AddCase(
pointHitTestJob,
caseCfg => caseCfg
.WithWorkload(_ => _.PointHitTest())
.WithGlobalSetup(_ => _.GlobalSetup())
.WithIterationSetup(_ => _.IterationSetup()))
.AddCases(
pointHitTestJob,
caseCfg => caseCfg
.WithWorkload(_ => _.PointHitTest())
.WithGlobalSetup(_ => _.GlobalSetup())
.WithIterationSetup(_ => _.IterationSetup())
.WithParameterValues(_ => _.MaxDepth, 1, 2, 3, 4, 5)
.WithParameterValues(_ => _.NodeSize, 256, 512, 1024))
.Build(immutableCfg);
```
With this configuration method there's no need in any attributes in benchmark classes.
So, if there's any sense, I can make PR to merge my developments.
Contributor guide
Assessment
This issue has not been assessed yet.