From 6861963b05c7577a8df181325aafe92603395ca6 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Mon, 30 Mar 2020 13:20:34 +0200 Subject: [PATCH 1/2] set WaitForDataBeforeAllocatingBuffer to false for PlatformBenchmarks --- .../PlatformBenchmarks/BenchmarkConfigurationHelpers.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/BenchmarksApps/Kestrel/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs b/src/BenchmarksApps/Kestrel/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs index 28e3551bf..03402897b 100644 --- a/src/BenchmarksApps/Kestrel/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs +++ b/src/BenchmarksApps/Kestrel/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs @@ -33,6 +33,10 @@ public static IWebHostBuilder UseBenchmarksConfiguration(this IWebHostBuilder bu { options.IOQueueCount = theadCount.Value; } + +#if NETCOREAPP5_0 + options.WaitForDataBeforeAllocatingBuffer = false; +#endif }); return builder; From b02fc3a3432a74734df6d23e428e9642bd15fe60 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Mon, 30 Mar 2020 13:23:25 +0200 Subject: [PATCH 2/2] simplify threadCount config logic --- .../BenchmarkConfigurationHelpers.cs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/BenchmarksApps/Kestrel/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs b/src/BenchmarksApps/Kestrel/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs index 03402897b..7c7c9b652 100644 --- a/src/BenchmarksApps/Kestrel/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs +++ b/src/BenchmarksApps/Kestrel/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs @@ -15,23 +15,11 @@ public static IWebHostBuilder UseBenchmarksConfiguration(this IWebHostBuilder bu { builder.UseConfiguration(configuration); - // Handle the transport type - var webHost = builder.GetSetting("KestrelTransport"); - - // Handle the thread count - var threadCountRaw = builder.GetSetting("threadCount"); - int? theadCount = null; - - if (!string.IsNullOrEmpty(threadCountRaw) && Int32.TryParse(threadCountRaw, out var value)) - { - theadCount = value; - } - builder.UseSockets(options => { - if (theadCount.HasValue) + if (int.TryParse(builder.GetSetting("threadCount"), out int threadCount)) { - options.IOQueueCount = theadCount.Value; + options.IOQueueCount = threadCount; } #if NETCOREAPP5_0