Feedback + Cleanup

This commit is contained in:
Ben Adams 2016-11-18 23:30:12 +00:00
parent 4cdcca212e
commit 7ab4442392
7 changed files with 5 additions and 19 deletions

View File

@ -43,6 +43,4 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance
All = uint.MaxValue All = uint.MaxValue
} }
} }

View File

@ -3,7 +3,6 @@
using BenchmarkDotNet.Configs; using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Engines; using BenchmarkDotNet.Engines;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Validators; using BenchmarkDotNet.Validators;
@ -17,10 +16,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance
Add(new RpsColumn()); Add(new RpsColumn());
Add(Job.Default. Add(Job.Default.
With(Platform.X64).
With(Jit.RyuJit).
With(BenchmarkDotNet.Environments.Runtime.Core). With(BenchmarkDotNet.Environments.Runtime.Core).
WithRemoveOutliers(true).
With(new GcMode() { Server = true }). With(new GcMode() { Server = true }).
With(RunStrategy.Throughput). With(RunStrategy.Throughput).
WithLaunchCount(3). WithLaunchCount(3).

View File

@ -20,7 +20,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance
With(Platform.X64). With(Platform.X64).
With(Jit.RyuJit). With(Jit.RyuJit).
With(BenchmarkDotNet.Environments.Runtime.Clr). With(BenchmarkDotNet.Environments.Runtime.Clr).
WithRemoveOutliers(true).
With(new GcMode() { Server = true }). With(new GcMode() { Server = true }).
With(RunStrategy.Throughput). With(RunStrategy.Throughput).
WithLaunchCount(3). WithLaunchCount(3).
@ -28,10 +27,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance
WithTargetCount(10)); WithTargetCount(10));
Add(Job.Default. Add(Job.Default.
With(Platform.X64).
With(Jit.RyuJit).
With(BenchmarkDotNet.Environments.Runtime.Core). With(BenchmarkDotNet.Environments.Runtime.Core).
WithRemoveOutliers(true).
With(new GcMode() { Server = true }). With(new GcMode() { Server = true }).
With(RunStrategy.Throughput). With(RunStrategy.Throughput).
WithLaunchCount(3). WithLaunchCount(3).

View File

@ -20,17 +20,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance
public override void ConnectionRead(string connectionId, int count) public override void ConnectionRead(string connectionId, int count)
{ {
//_logger.LogDebug(1, @"Connection id ""{ConnectionId}"" recv {count} bytes.", connectionId, count);
} }
public override void ConnectionWrite(string connectionId, int count) public override void ConnectionWrite(string connectionId, int count)
{ {
//_logger.LogDebug(1, @"Connection id ""{ConnectionId}"" send {count} bytes.", connectionId, count);
} }
public override void ConnectionWriteCallback(string connectionId, int status) public override void ConnectionWriteCallback(string connectionId, int status)
{ {
//_logger.LogDebug(1, @"Connection id ""{ConnectionId}"" send finished with status {status}.", connectionId, status);
} }
} }
} }

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text;
namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure
{ {
@ -13,6 +14,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure
public static readonly int? ECONNRESET = GetECONNRESET(); public static readonly int? ECONNRESET = GetECONNRESET();
public static readonly int? EADDRINUSE = GetEADDRINUSE(); public static readonly int? EADDRINUSE = GetEADDRINUSE();
public static readonly Encoding UTF8 = Encoding.UTF8;
/// <summary> /// <summary>
/// Prefix of host name used to specify Unix sockets in the configuration. /// Prefix of host name used to specify Unix sockets in the configuration.
/// </summary> /// </summary>

View File

@ -21,7 +21,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure
0x02ul << 40 | 0x02ul << 40 |
0x01ul << 48 ) + 1; 0x01ul << 48 ) + 1;
private static readonly Encoding _utf8 = Encoding.UTF8;
private static readonly int _vectorSpan = Vector<byte>.Count; private static readonly int _vectorSpan = Vector<byte>.Count;
private MemoryPoolBlock _block; private MemoryPoolBlock _block;
@ -1124,10 +1123,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure
} }
if (end.Block == Block) if (end.Block == Block)
{ {
return _utf8.GetString(Block.Array, Index, end.Index - Index); return Constants.UTF8.GetString(Block.Array, Index, end.Index - Index);
} }
var decoder = _utf8.GetDecoder(); var decoder = Constants.UTF8.GetDecoder();
var length = GetLength(end); var length = GetLength(end);
var charLength = length; var charLength = length;

View File

@ -6,14 +6,11 @@ using System.Diagnostics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text; using System.Text;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.Kestrel.Internal.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure
{ {
public static class MemoryPoolIteratorExtensions public static class MemoryPoolIteratorExtensions
{ {
private static readonly Encoding _utf8 = Encoding.UTF8;
public const string Http10Version = "HTTP/1.0"; public const string Http10Version = "HTTP/1.0";
public const string Http11Version = "HTTP/1.1"; public const string Http11Version = "HTTP/1.1";