Skip to content

Commit 342314f

Browse files
authored
Set WaitForDataBeforeAllocatingBuffer to false for PlatformBenchmarks (#1469)
1 parent d1e9269 commit 342314f

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/BenchmarksApps/Kestrel/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,16 @@ public static IWebHostBuilder UseBenchmarksConfiguration(this IWebHostBuilder bu
1515
{
1616
builder.UseConfiguration(configuration);
1717

18-
// Handle the transport type
19-
var webHost = builder.GetSetting("KestrelTransport");
20-
21-
// Handle the thread count
22-
var threadCountRaw = builder.GetSetting("threadCount");
23-
int? theadCount = null;
24-
25-
if (!string.IsNullOrEmpty(threadCountRaw) && Int32.TryParse(threadCountRaw, out var value))
26-
{
27-
theadCount = value;
28-
}
29-
3018
builder.UseSockets(options =>
3119
{
32-
if (theadCount.HasValue)
20+
if (int.TryParse(builder.GetSetting("threadCount"), out int threadCount))
3321
{
34-
options.IOQueueCount = theadCount.Value;
22+
options.IOQueueCount = threadCount;
3523
}
24+
25+
#if NETCOREAPP5_0
26+
options.WaitForDataBeforeAllocatingBuffer = false;
27+
#endif
3628
});
3729

3830
return builder;

0 commit comments

Comments
 (0)