NBench 0.1.0
See the version list below for details.
dotnet add package NBench --version 0.1.0
NuGet\Install-Package NBench -Version 0.1.0
<PackageReference Include="NBench" Version="0.1.0" />
paket add NBench --version 0.1.0
#r "nuget: NBench, 0.1.0"
// Install NBench as a Cake Addin #addin nuget:?package=NBench&version=0.1.0 // Install NBench as a Cake Tool #tool nuget:?package=NBench&version=0.1.0
NBench is a cross-platform automated performance profiling and testing framework for.NET applications.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on NBench:
Package | Downloads |
---|---|
Pro.NBench.xUnit
Allows NBench tests to be discovered, executed, reported, and debugged using xUnit in ReSharper, and Visual Studio Test Explorer. Please refer to the project Url for usage information: https://github.com/Pro-Coded/Pro.NBench.xUnit |
|
NBench.PerformanceCounters
Windows only. Adds performance counter support to NBench measurements. |
|
NBench.Runner.DotNetCli
Cross-platform performance benchmarking and testing framework for .NET applications. |
|
NBench-PerfAssert
Package Description |
GitHub repositories (8)
Showing the top 5 popular GitHub repositories that depend on NBench:
Repository | Stars |
---|---|
akkadotnet/akka.net
Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
|
|
Azure/DotNetty
DotNetty project – a port of netty, event-driven asynchronous network application framework
|
|
RicoSuter/NJsonSchema
JSON Schema reader, generator and validator for .NET
|
|
SonarSource/sonar-dotnet
Code analyzer for C# and VB.NET projects
|
|
helios-io/helios
reactive socket middleware for .NET
|
Version | Downloads | Last updated |
---|---|---|
2.0.1 | 293,426 | 2/25/2020 |
2.0.0 | 683 | 2/24/2020 |
1.2.2 | 229,956 | 7/24/2018 |
1.2.1 | 2,614 | 7/11/2018 |
1.2.0 | 1,226 | 7/10/2018 |
1.1.0 | 7,073 | 7/2/2018 |
1.0.4 | 124,764 | 6/16/2017 |
1.0.3 | 1,373 | 6/11/2017 |
1.0.2 | 1,535 | 6/2/2017 |
1.0.1 | 25,853 | 3/31/2017 |
1.0.0 | 4,143 | 3/15/2017 |
0.3.4 | 44,714 | 12/16/2016 |
0.3.3 | 1,704 | 12/8/2016 |
0.3.2 | 1,381 | 12/8/2016 |
0.3.1 | 11,342 | 8/16/2016 |
0.3.0 | 8,312 | 5/24/2016 |
0.2.2 | 2,563 | 5/3/2016 |
0.2.1 | 2,654 | 4/7/2016 |
0.2.0 | 1,387 | 4/6/2016 |
0.1.6 | 1,782 | 2/15/2016 |
0.1.5 | 15,106 | 12/10/2015 |
0.1.4 | 1,172 | 12/10/2015 |
0.1.3 | 1,173 | 12/8/2015 |
0.1.2 | 1,143 | 12/8/2015 |
0.1.1 | 1,128 | 12/7/2015 |
0.1.0 | 1,393 | 12/4/2015 |
0.0.2 | 1,470 | 12/4/2015 |
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`.