@@ -41,9 +41,6 @@ EndProject | |||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MQTTnet.Benchmarks", "Tests\MQTTnet.Benchmarks\MQTTnet.Benchmarks.csproj", "{998D04DD-7CB0-45F5-A393-E2495C16399E}" | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MQTTnet.Benchmarks", "Tests\MQTTnet.Benchmarks\MQTTnet.Benchmarks.csproj", "{998D04DD-7CB0-45F5-A393-E2495C16399E}" | ||||
EndProject | EndProject | ||||
Global | Global | ||||
GlobalSection(Performance) = preSolution | |||||
HasPerformanceSessions = true | |||||
EndGlobalSection | |||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
Debug|Any CPU = Debug|Any CPU | Debug|Any CPU = Debug|Any CPU | ||||
Debug|ARM = Debug|ARM | Debug|ARM = Debug|ARM | ||||
@@ -0,0 +1,23 @@ | |||||
using System.Linq; | |||||
using BenchmarkDotNet.Configs; | |||||
using BenchmarkDotNet.Jobs; | |||||
using BenchmarkDotNet.Validators; | |||||
namespace MQTTnet.Benchmarks | |||||
{ | |||||
/// <summary> | |||||
/// this options may be used to run benchmarks in debugmode and attach a performance profiler | |||||
/// https://benchmarkdotnet.org/Configs/Configs.htm | |||||
/// </summary> | |||||
public class AllowNonOptimized : ManualConfig | |||||
{ | |||||
public AllowNonOptimized() | |||||
{ | |||||
Add(JitOptimizationsValidator.DontFailOnError); // ALLOW NON-OPTIMIZED DLLS | |||||
Add(DefaultConfig.Instance.GetLoggers().ToArray()); // manual config has no loggers by default | |||||
Add(DefaultConfig.Instance.GetExporters().ToArray()); // manual config has no exporters by default | |||||
Add(DefaultConfig.Instance.GetColumnProviders().ToArray()); // manual config has no columns by default | |||||
Add(Job.InProcess); | |||||
} | |||||
} | |||||
} |
@@ -1,9 +1,4 @@ | |||||
using BenchmarkDotNet.Attributes; | using BenchmarkDotNet.Attributes; | ||||
using BenchmarkDotNet.Attributes.Exporters; | |||||
using BenchmarkDotNet.Attributes.Jobs; | |||||
using BenchmarkDotNet.Configs; | |||||
using BenchmarkDotNet.Jobs; | |||||
using BenchmarkDotNet.Validators; | |||||
using MQTTnet.Adapter; | using MQTTnet.Adapter; | ||||
using MQTTnet.Core.Internal; | using MQTTnet.Core.Internal; | ||||
using MQTTnet.Diagnostics; | using MQTTnet.Diagnostics; | ||||
@@ -11,27 +6,11 @@ using MQTTnet.Internal; | |||||
using MQTTnet.Packets; | using MQTTnet.Packets; | ||||
using MQTTnet.Serializer; | using MQTTnet.Serializer; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | |||||
using System.IO; | using System.IO; | ||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading; | using System.Threading; | ||||
using System.Threading.Tasks; | |||||
namespace MQTTnet.Benchmarks | namespace MQTTnet.Benchmarks | ||||
{ | { | ||||
public class AllowNonOptimized : ManualConfig | |||||
{ | |||||
public AllowNonOptimized() | |||||
{ | |||||
Add(JitOptimizationsValidator.DontFailOnError); // ALLOW NON-OPTIMIZED DLLS | |||||
Add(DefaultConfig.Instance.GetLoggers().ToArray()); // manual config has no loggers by default | |||||
Add(DefaultConfig.Instance.GetExporters().ToArray()); // manual config has no exporters by default | |||||
Add(DefaultConfig.Instance.GetColumnProviders().ToArray()); // manual config has no columns by default | |||||
Add(Job.InProcess); | |||||
} | |||||
} | |||||
[MemoryDiagnoser] | [MemoryDiagnoser] | ||||
public class ChannelAdapterBenchmark | public class ChannelAdapterBenchmark | ||||
{ | { | ||||