You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Program.cs 2.0 KiB

6 years ago
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using BenchmarkDotNet.Running;
  3. using MQTTnet.Benchmarks.Configurations;
  4. using MQTTnet.Diagnostics;
  5. namespace MQTTnet.Benchmarks
  6. {
  7. public static class Program
  8. {
  9. public static void Main(string[] args)
  10. {
  11. Console.WriteLine($"MQTTnet - BenchmarkApp.{TargetFrameworkInfoProvider.TargetFramework}");
  12. Console.WriteLine("1 = MessageProcessingBenchmark");
  13. Console.WriteLine("2 = SerializerBenchmark");
  14. Console.WriteLine("3 = LoggerBenchmark");
  15. Console.WriteLine("4 = TopicFilterComparerBenchmark");
  16. Console.WriteLine("5 = ChannelAdapterBenchmark");
  17. Console.WriteLine("6 = MqttTcpChannelBenchmark");
  18. Console.WriteLine("7 = TcpPipesBenchmark");
  19. Console.WriteLine("8 = MessageProcessingMqttConnectionContextBenchmark");
  20. var pressedKey = Console.ReadKey(true);
  21. switch (pressedKey.KeyChar)
  22. {
  23. case '1':
  24. BenchmarkRunner.Run<MessageProcessingBenchmark>();
  25. break;
  26. case '2':
  27. BenchmarkRunner.Run<SerializerBenchmark>();
  28. break;
  29. case '3':
  30. BenchmarkRunner.Run<LoggerBenchmark>();
  31. break;
  32. case '4':
  33. BenchmarkRunner.Run<TopicFilterComparerBenchmark>();
  34. break;
  35. case '5':
  36. BenchmarkRunner.Run<ChannelAdapterBenchmark>();
  37. break;
  38. case '6':
  39. BenchmarkRunner.Run<MqttTcpChannelBenchmark>();
  40. break;
  41. case '7':
  42. BenchmarkRunner.Run<TcpPipesBenchmark>();
  43. break;
  44. case '8':
  45. BenchmarkRunner.Run<MessageProcessingMqttConnectionContextBenchmark>(new RuntimeCompareConfig()/*new AllowNonOptimized()*/);
  46. break;
  47. }
  48. Console.ReadLine();
  49. }
  50. }
  51. }