NBench 0.3.0
NBench is a cross-platform automated performance profiling and testing framework for.NET applications.
Showing the top 20 packages that depend on NBench.
Packages | Downloads |
---|---|
NBench.Runner
Cross-platform performance benchmarking and testing framework for .NET applications.
|
18 |
NBench.Runner
Cross-platform performance benchmarking and testing framework for .NET applications.
|
22 |
NBench.Runner
NBench is a cross-platform automated performance profiling and testing framework for.NET applications.
|
18 |
This release introduces some breaking changes to NBench:
Tracing**
The biggest feature included in this release is the addition of tracing support, which is exposed directly to end-users so they can capture trace events and include them in the output produced by NBench.
You can access the `IBenchmarkTrace` object through the `BenchmarkContext` passed into any of your `PerfSetup`, `PerfBenchmark`, or `PerfCleanup` methods like such:
```csharp
public class TracingBenchmark
{
[PerfSetup]
public void Setup(BenchmarkContext context)
{
context.Trace.Debug(SetupTrace);
}
[PerfBenchmark(TestMode = TestMode.Test, NumberOfIterations = IterationCount, RunTimeMilliseconds = 1000)]
[MemoryMeasurement(MemoryMetric.TotalBytesAllocated)]
[MemoryAssertion(MemoryMetric.TotalBytesAllocated, MustBe.LessThan, ByteConstants.EightKb)]
public void Run1(BenchmarkContext context)
{
context.Trace.Debug(RunTrace);
}
[PerfCleanup]
public void Cleanup(BenchmarkContext context)
{
context.Trace.Info(CleanupTrace);
}
}
```
`NBench.Runner.exe` now takes a `trace=true|false` commandline argument, which will enable the new tracing feature introduced in this release.
Tracing is disabled by default**.
Skippable Warmups**
You can now elect to skip warmups altogether for your specs. This feature is particularly useful for long-running iteration benchmarks, which are often used for stress tests. Warmups don't add any value here.
Here's how you can skip warmups:
```csharp
[PerfBenchmark(TestMode = TestMode.Test, NumberOfIterations = IterationCount, RunTimeMilliseconds = 1000, SkipWarmups = true)]
[MemoryMeasurement(MemoryMetric.TotalBytesAllocated)]
[MemoryAssertion(MemoryMetric.TotalBytesAllocated, MustBe.LessThan, ByteConstants.EightKb)]
public void Run1(BenchmarkContext context)
{
context.Trace.Debug(RunTrace);
}
```
Just set `SkipWarmups = true` on your `PerfBenchmark` attribute wherever you wish to skip a warmup.
Foreground thread is no longer given high priority when concurrent mode is on**.
If you are running the `NBench.Runner` with `concurrent=true`, we no longer give the main foreground thread high priority as this resulted in some unfair scheduling during concurrent tests. All threads within the `NBench.Runner` process all share the same priority now.
Markdown reports include additional data**
All markdown reports now include:
The concurrency setting for NBench
The tracing setting for NBench
A flag indicating if warmups were skipped or not
All of these were added in order to make it easy for end-users reading the reports to know what the NBench settings were at the time the report was produced.
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
2.0.1 | 42 | 02/13/2024 |
2.0.0 | 24 | 02/13/2024 |
1.2.2 | 28 | 02/13/2024 |
1.2.1 | 32 | 02/13/2024 |
1.2.0 | 28 | 02/13/2024 |
1.1.0 | 29 | 02/13/2024 |
1.0.4 | 26 | 02/13/2024 |
1.0.3 | 26 | 02/13/2024 |
1.0.2 | 28 | 02/13/2024 |
1.0.1 | 27 | 02/13/2024 |
1.0.0 | 29 | 02/13/2024 |
0.3.4 | 26 | 02/13/2024 |
0.3.3 | 20 | 02/13/2024 |
0.3.2 | 33 | 02/13/2024 |
0.3.1 | 31 | 02/13/2024 |
0.3.0 | 21 | 02/13/2024 |
0.2.2 | 32 | 02/13/2024 |
0.2.1 | 26 | 02/13/2024 |
0.2.0 | 28 | 02/13/2024 |
0.1.6 | 27 | 02/10/2020 |
0.1.5 | 27 | 02/10/2020 |
0.1.4 | 29 | 02/13/2024 |
0.1.3 | 32 | 02/13/2024 |
0.1.2 | 21 | 02/13/2024 |
0.1.1 | 23 | 02/13/2024 |
0.1.0 | 33 | 02/13/2024 |
0.0.2 | 29 | 02/13/2024 |