Use common BDN config (#2233)

This commit is contained in:
Pavel Krymets 2017-12-22 09:51:26 -08:00 committed by GitHub
parent dfaf37cbba
commit e7cc0d33af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 1 additions and 48 deletions

View File

@ -0,0 +1 @@
[assembly: BenchmarkDotNet.Attributes.AspNetCoreBenchmark]

View File

@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class DotSegmentRemovalBenchmark
{
// Immutable

View File

@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Performance.Mocks;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class Http1ConnectionParsingOverheadBenchmark
{
private const int InnerLoopCount = 512;

View File

@ -16,7 +16,6 @@ using Microsoft.AspNetCore.Testing;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class Http1WritingBenchmark
{
// Standard completed task

View File

@ -8,8 +8,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class HttpParserBenchmark : IHttpRequestLineHandler, IHttpHeadersHandler
{
private readonly HttpParser<Adapter> _parser = new HttpParser<Adapter>();

View File

@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class HttpProtocolFeatureCollection
{
private readonly Http1Connection _http1Connection;

View File

@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class KnownStringsBenchmark
{
static byte[] _methodConnect = Encoding.ASCII.GetBytes("CONNECT ");

View File

@ -8,7 +8,6 @@ using BenchmarkDotNet.Attributes;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class PipeThroughputBenchmark
{
private const int _writeLenght = 57;

View File

@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Performance.Mocks;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class RequestParsingBenchmark
{
public IPipe Pipe { get; set; }

View File

@ -15,7 +15,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class ResponseHeaderCollectionBenchmark
{
private const int InnerLoopCount = 512;

View File

@ -17,7 +17,6 @@ using Microsoft.AspNetCore.Testing;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class ResponseHeadersWritingBenchmark
{
private static readonly byte[] _helloWorldPayload = Encoding.ASCII.GetBytes("Hello, World!");

View File

@ -6,7 +6,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
[ParameterizedJobConfig(typeof(CoreConfig))]
public class StringUtilitiesBenchmark
{
private const int Iterations = 500_000;

View File

@ -1,36 +0,0 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Engines;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Validators;
namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
public class CoreConfig : ManualConfig
{
public CoreConfig() : this(Job.Core
.WithRemoveOutliers(false)
.With(new GcMode() { Server = true })
.With(RunStrategy.Throughput)
.WithLaunchCount(3)
.WithWarmupCount(5)
.WithTargetCount(10))
{
Add(JitOptimizationsValidator.FailOnError);
}
public CoreConfig(Job job)
{
Add(DefaultConfig.Instance);
Add(MemoryDiagnoser.Default);
Add(StatisticColumn.OperationsPerSecond);
Add(job);
}
}
}