Skip to content

Commit

Permalink
Update microbench
Browse files Browse the repository at this point in the history
  • Loading branch information
cuteant committed Jun 28, 2020
1 parent f68b7ee commit 3f5bef6
Show file tree
Hide file tree
Showing 30 changed files with 142 additions and 193 deletions.
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

<!-- Common compile parameters -->
<PropertyGroup>
<LangVersion>latest</LangVersion>
<LangVersion>8.0</LangVersion>
<!--<LangVersion>latest</LangVersion>-->
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<TieredCompilation>true</TieredCompilation>
Expand Down
21 changes: 20 additions & 1 deletion DotNetty.CrossPlatform.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3D04C4DC-6F8E-4326-9569-92F3E26C6EEB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{B6984E67-A4D0-459E-B3C9-01CA4DBBE241}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmark", "benchmark", "{B6984E67-A4D0-459E-B3C9-01CA4DBBE241}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetty.Common", "src\DotNetty.Common\DotNetty.Common.csproj", "{3B9613C3-0FE1-4F7A-AD5A-454952629867}"
EndProject
Expand All @@ -36,6 +36,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetty.Codecs.Http2", "sr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetty.Codecs.Protobuf", "src\DotNetty.Codecs.Protobuf\DotNetty.Codecs.Protobuf.csproj", "{F5A34D9C-854C-4972-ABF3-8BAE4712386D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetty.Microbench", "perf\DotNetty.Microbench\DotNetty.Microbench.csproj", "{10264C0F-F854-4201-AFCB-2B7315EFBCE0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -224,6 +226,22 @@ Global
{F5A34D9C-854C-4972-ABF3-8BAE4712386D}.Release|x64.Build.0 = Release|Any CPU
{F5A34D9C-854C-4972-ABF3-8BAE4712386D}.Release|x86.ActiveCfg = Release|Any CPU
{F5A34D9C-854C-4972-ABF3-8BAE4712386D}.Release|x86.Build.0 = Release|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Debug|ARM.ActiveCfg = Debug|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Debug|ARM.Build.0 = Debug|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Debug|x64.ActiveCfg = Debug|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Debug|x64.Build.0 = Debug|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Debug|x86.ActiveCfg = Debug|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Debug|x86.Build.0 = Debug|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Release|Any CPU.Build.0 = Release|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Release|ARM.ActiveCfg = Release|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Release|ARM.Build.0 = Release|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Release|x64.ActiveCfg = Release|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Release|x64.Build.0 = Release|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Release|x86.ActiveCfg = Release|Any CPU
{10264C0F-F854-4201-AFCB-2B7315EFBCE0}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -240,6 +258,7 @@ Global
{87DD4EAA-BBCF-439F-A263-59044B6E8930} = {3D04C4DC-6F8E-4326-9569-92F3E26C6EEB}
{85BC5580-3A11-4078-8DB7-3C113DA938A2} = {3D04C4DC-6F8E-4326-9569-92F3E26C6EEB}
{F5A34D9C-854C-4972-ABF3-8BAE4712386D} = {3D04C4DC-6F8E-4326-9569-92F3E26C6EEB}
{10264C0F-F854-4201-AFCB-2B7315EFBCE0} = {B6984E67-A4D0-459E-B3C9-01CA4DBBE241}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A659CEFB-DDB3-49BE-AEDD-FF2F1B3297DB}
Expand Down
2 changes: 0 additions & 2 deletions DotNetty.sln
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetty.Codecs.Redis.Tests
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetty.Transport.Libuv", "src\DotNetty.Transport.Libuv\DotNetty.Transport.Libuv.csproj", "{F89EE43E-F0AE-4EA1-BEFF-6322C6E8EAF5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmark", "benchmark", "{78B5F58B-549D-42E7-BA3D-9E85B7CBCC78}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetty.Codecs.Http", "src\DotNetty.Codecs.Http\DotNetty.Codecs.Http.csproj", "{87DD4EAA-BBCF-439F-A263-59044B6E8930}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetty.Codecs.Http.Tests", "test\DotNetty.Codecs.Http.Tests\DotNetty.Codecs.Http.Tests.csproj", "{26A8779A-44B1-46D4-A43E-FA2616EBFD02}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ namespace DotNetty.Microbench.Allocators
{
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Buffers;
using DotNetty.Common;

[CoreJob]
[BenchmarkCategory("ByteBufferAllocator")]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[MemoryDiagnoser]
[RPlotExporter]
[BenchmarkCategory("ByteBufferAllocator")]
public abstract class AbstractByteBufferAllocatorBenchmark
{
const int MaxLiveBuffers = 8192;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ namespace DotNetty.Microbench.Buffers
{
using System.Text;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Buffers;
using DotNetty.Common;

[CoreJob]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[MemoryDiagnoser]
[RPlotExporter]
[BenchmarkCategory("ByteBuffer")]
public class ByteBufUtilBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ namespace DotNetty.Microbench.Buffers
{
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Buffers;
using DotNetty.Common;
#if DESKTOPCLR
using BenchmarkDotNet.Diagnostics.Windows.Configs;
#endif

#if !DESKTOPCLR
[CoreJob]
#else
[ClrJob]
[InliningDiagnoser]
#endif

[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[MemoryDiagnoser]
[RPlotExporter]
[BenchmarkCategory("ByteBuffer")]
public class ByteBufferBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@
namespace DotNetty.Microbench.Buffers
{
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Buffers;
using DotNetty.Common;
#if DESKTOPCLR
using BenchmarkDotNet.Diagnostics.Windows.Configs;
#endif

#if !DESKTOPCLR
[CoreJob]
#else
[ClrJob]
[InliningDiagnoser]
#endif

[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[MemoryDiagnoser]
[RPlotExporter]
[BenchmarkCategory("ByteBuffer")]
public class PooledByteBufferBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@
namespace DotNetty.Microbench.Buffers
{
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Buffers;
using DotNetty.Common;
#if DESKTOPCLR
using BenchmarkDotNet.Diagnostics.Windows.Configs;
#endif

#if !DESKTOPCLR
[CoreJob]
#else
[ClrJob]
[InliningDiagnoser]
#endif
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[MemoryDiagnoser]
[RPlotExporter]
[BenchmarkCategory("ByteBuffer")]
public class UnpooledByteBufferBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ namespace DotNetty.Microbench.Codecs
{
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Codecs;

[CoreJob]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[BenchmarkCategory("Codecs")]
public class DateFormatterBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ namespace DotNetty.Microbench.Common
using System;
using System.Text;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Common.Internal;
using DotNetty.Common.Utilities;
#if DESKTOPCLR
using BenchmarkDotNet.Diagnostics.Windows.Configs;
#endif

#if !DESKTOPCLR
[CoreJob]
#else
[ClrJob]
[InliningDiagnoser]
#endif
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[BenchmarkCategory("Common")]
public class AsciiStringBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
namespace DotNetty.Microbench.Concurrency
{
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Common;

[CoreJob]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[BenchmarkCategory("Concurrency")]
public class FastThreadLocalBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ namespace DotNetty.Microbench.Concurrency
using System;
using System.Threading;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Engines;
using BenchmarkDotNet.Jobs;
using DotNetty.Common.Concurrency;
using DotNetty.Common.Internal;

[SimpleJob(RunStrategy.Monitoring)]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[BenchmarkCategory("Concurrency")]
public class SingleThreadEventExecutorBenchmark
{
Expand Down
24 changes: 24 additions & 0 deletions perf/DotNetty.Microbench/Config/ParamsDisplayInfoColumn.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;

namespace DotNetty.Microbench
{
public class ParamsSummaryColumn : IColumn
{
public string Id => nameof(ParamsSummaryColumn);
public string ColumnName { get; } = "Params";
public bool IsDefault(Summary summary, BenchmarkCase benchmarkCase) => false;
public string GetValue(Summary summary, BenchmarkCase benchmarkCase) => benchmarkCase.Parameters.DisplayInfo;
public bool IsAvailable(Summary summary) => true;
public bool AlwaysShow => true;
public ColumnCategory Category => ColumnCategory.Params;
public int PriorityInCategory => 0;
public override string ToString() => ColumnName;
public bool IsNumeric => false;
public UnitType UnitType => UnitType.Dimensionless;
public string GetValue(Summary summary, BenchmarkCase benchmarkCase, SummaryStyle style) => GetValue(summary, benchmarkCase);

public string Legend => $"Summary of all parameter values";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DotNetty.Codecs.Http\DotNetty.Codecs.Http.csproj" />
<ProjectReference Include="..\..\src\DotNetty.Codecs.Http2\DotNetty.Codecs.Http2.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ namespace DotNetty.Microbench.Headers
{
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Engines;
using BenchmarkDotNet.Jobs;
using DotNetty.Codecs;
using DotNetty.Codecs.Http;
using DotNetty.Common;
using DotNetty.Common.Utilities;

[SimpleJob(RunStrategy.Monitoring, 10, 5, 10)]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[BenchmarkCategory("Headers")]
public class HeadersBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
namespace DotNetty.Microbench.Http
{
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Codecs.Http.Cookies;
using DotNetty.Common;

[CoreJob]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[MemoryDiagnoser]
[BenchmarkCategory("Http")]
public class ClientCookieDecoderBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ namespace DotNetty.Microbench.Http
{
using System.Text;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Engines;
using BenchmarkDotNet.Jobs;
using DotNetty.Buffers;
using DotNetty.Codecs.Http;
using DotNetty.Common;
using DotNetty.Transport.Channels.Embedded;

[SimpleJob(RunStrategy.Monitoring, 10, 5, 20)]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[BenchmarkCategory("Http")]
public class HttpRequestDecoderBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
namespace DotNetty.Microbench.Http
{
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Buffers;
using DotNetty.Codecs.Http;
using DotNetty.Common;

[CoreJob]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[MemoryDiagnoser]
[BenchmarkCategory("Http")]
public class HttpRequestEncoderInsertBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
namespace DotNetty.Microbench.Http
{
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Buffers;
using DotNetty.Codecs.Http;
using DotNetty.Common;
using DotNetty.Common.Utilities;

[CoreJob]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[MemoryDiagnoser]
[BenchmarkCategory("Http")]
public class WriteBytesVsShortOrMediumBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
namespace DotNetty.Microbench.Internal
{
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using DotNetty.Common.Internal;

[CoreJob]
[SimpleJob(RuntimeMoniker.Net48)]
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[RPlotExporter]
[MemoryDiagnoser]
[BenchmarkCategory("Internal")]
public class PlatformDependentBenchmark
{
Expand Down
Loading

0 comments on commit 3f5bef6

Please sign in to comment.