NBench 0.1.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 |
First "production-ready" release of NBench.
Please see our detailed [NBench README and FAQ](https://github.com/petabridge/nbench) for instructions and documentation!
To use NBench, install the NBench package from NuGet:
```
PS> Install-Package NBench
```
And then create a POCO class with a default constructor and some methods, like this:
```csharp
using NBench.Util;
using NBench;
/// <summary>
/// Test to see if we can achieve max throughput on a <see cref="AtomicCounter"/>
/// </summary>
public class CounterPerfSpecs
{
private Counter _counter;
[PerfSetup]
public void Setup(BenchmarkContext context)
{
_counter = context.GetCounter("TestCounter");
}
[PerfBenchmark(Description = "Test to ensure that a minimal throughput test can be rapidly executed.",
NumberOfIterations = 3, RunMode = RunMode.Throughput,
RunTimeMilliseconds = 1000, TestMode = TestMode.Test)]
[CounterThroughputAssertion("TestCounter", MustBe.GreaterThan, 10000000.0d)]
[MemoryAssertion(MemoryMetric.TotalBytesAllocated, MustBe.LessThanOrEqualTo, ByteConstants.ThirtyTwoKb)]
[GcTotalAssertion(GcMetric.TotalCollections, GcGeneration.Gen2, MustBe.ExactlyEqualTo, 0.0d)]
public void Benchmark()
{
_counter.Increment();
}
[PerfCleanup]
public void Cleanup(){
// does nothing
}
}
```
After defining some NBench `PerfBenchmark` methods and declaring some measurements, you can run your benchmark by downloading the `NBench.Runner.exe` via NuGet.
```
PS> Install-Package NBench.Runner
PS> .\packages\NBench.Runner\NBench.Runner.exe .\src\bin\Debug\MyPerfTests.dll output-directory="C:\Perf"
```
And this command will run your `PerfBenchmark` and write output [that looks like this](https://gist.github.com/Aaronontheweb/8e0bfa2cccc63f5bd8bf) to a markdown file in the `output-directory`.
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 |