Skip to content

Commit bd1e87e

Browse files
committed
Add simple protocol performance benchmarks
1 parent e2dc8b3 commit bd1e87e

11 files changed

Lines changed: 570 additions & 5 deletions

File tree

NetCoreServer.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtoClient", "examples\Pro
113113
EndProject
114114
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtoServer", "examples\ProtoServer\ProtoServer.csproj", "{8E48ACC4-F944-44BA-AEF7-3417D60160F3}"
115115
EndProject
116+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtoClient", "performance\ProtoClient\ProtoClient.csproj", "{FF5FC891-4B49-4D2C-9342-252BA4FB9F25}"
117+
EndProject
118+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtoServer", "performance\ProtoServer\ProtoServer.csproj", "{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4}"
119+
EndProject
116120
Global
117121
GlobalSection(SolutionConfigurationPlatforms) = preSolution
118122
Debug|Any CPU = Debug|Any CPU
@@ -529,6 +533,22 @@ Global
529533
{8E48ACC4-F944-44BA-AEF7-3417D60160F3}.Release|Any CPU.Build.0 = Release|Any CPU
530534
{8E48ACC4-F944-44BA-AEF7-3417D60160F3}.Release|x64.ActiveCfg = Release|Any CPU
531535
{8E48ACC4-F944-44BA-AEF7-3417D60160F3}.Release|x64.Build.0 = Release|Any CPU
536+
{FF5FC891-4B49-4D2C-9342-252BA4FB9F25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
537+
{FF5FC891-4B49-4D2C-9342-252BA4FB9F25}.Debug|Any CPU.Build.0 = Debug|Any CPU
538+
{FF5FC891-4B49-4D2C-9342-252BA4FB9F25}.Debug|x64.ActiveCfg = Debug|Any CPU
539+
{FF5FC891-4B49-4D2C-9342-252BA4FB9F25}.Debug|x64.Build.0 = Debug|Any CPU
540+
{FF5FC891-4B49-4D2C-9342-252BA4FB9F25}.Release|Any CPU.ActiveCfg = Release|Any CPU
541+
{FF5FC891-4B49-4D2C-9342-252BA4FB9F25}.Release|Any CPU.Build.0 = Release|Any CPU
542+
{FF5FC891-4B49-4D2C-9342-252BA4FB9F25}.Release|x64.ActiveCfg = Release|Any CPU
543+
{FF5FC891-4B49-4D2C-9342-252BA4FB9F25}.Release|x64.Build.0 = Release|Any CPU
544+
{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
545+
{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
546+
{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4}.Debug|x64.ActiveCfg = Debug|Any CPU
547+
{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4}.Debug|x64.Build.0 = Debug|Any CPU
548+
{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
549+
{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4}.Release|Any CPU.Build.0 = Release|Any CPU
550+
{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4}.Release|x64.ActiveCfg = Release|Any CPU
551+
{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4}.Release|x64.Build.0 = Release|Any CPU
532552
EndGlobalSection
533553
GlobalSection(SolutionProperties) = preSolution
534554
HideSolutionNode = FALSE
@@ -584,6 +604,8 @@ Global
584604
{0A31A021-B53C-4B1B-A408-A46ABC97C93F} = {7535CE12-3B22-4473-890A-980B72E5D27A}
585605
{6F0566A8-39A6-4910-BBE9-8F0B2CAEF50F} = {81ED94B5-0C65-432C-AEF5-67C3DFF7F2EE}
586606
{8E48ACC4-F944-44BA-AEF7-3417D60160F3} = {81ED94B5-0C65-432C-AEF5-67C3DFF7F2EE}
607+
{FF5FC891-4B49-4D2C-9342-252BA4FB9F25} = {8965E5CD-E36E-4DC5-A36E-827AFFC642D1}
608+
{CA22BAB3-2DF7-4DFE-AAD6-11A1ADDA17A4} = {8965E5CD-E36E-4DC5-A36E-827AFFC642D1}
587609
EndGlobalSection
588610
GlobalSection(ExtensibilityGlobals) = postSolution
589611
SolutionGuid = {64415837-63D9-474E-A25C-EE91C9CA90C5}

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Has integration with message protocol based on [Fast Binary Encoding](https://gi
4949
* [SSL echo server](#ssl-echo-server)
5050
* [UDP echo server](#udp-echo-server)
5151
* [Unix Domain Socket echo server](#unix-domain-socket-echo-server)
52+
* [Simple protocol server](#simple-protocol-server)
5253
* [WebSocket echo server](#websocket-echo-server)
5354
* [WebSocket secure echo server](#websocket-secure-echo-server)
5455
* [Benchmark: Multicast](#benchmark-multicast)
@@ -3324,6 +3325,50 @@ Message latency: 620 ns
33243325
Message throughput: 1610666 msg/s
33253326
```
33263327

3328+
### Simple protocol server
3329+
3330+
* [ProtoServer](https://github.com/chronoxor/NetCoreServer/blob/master/performance/ProtoServer/Program.cs)
3331+
* [ProtoClient](https://github.com/chronoxor/NetCoreServer/blob/master/performance/ProtoClient/Program.cs) --clients 1
3332+
3333+
```
3334+
Server address: 127.0.0.1
3335+
Server port: 4444
3336+
Working clients: 1
3337+
Working messages: 1000
3338+
Message size: 32
3339+
Seconds to benchmarking: 10
3340+
3341+
Errors: 0
3342+
3343+
Total time: 10.015 s
3344+
Total data: 100.568 MiB
3345+
Total messages: 3294993
3346+
Data throughput: 10.040 MiB/s
3347+
Message latency: 3.039 mcs
3348+
Message throughput: 328978 msg/s
3349+
```
3350+
3351+
* [ProtoServer](https://github.com/chronoxor/NetCoreServer/blob/master/performance/ProtoServer/Program.cs)
3352+
* [ProtoClient](https://github.com/chronoxor/NetCoreServer/blob/master/performance/ProtoClient/Program.cs) --clients 100
3353+
3354+
```
3355+
Server address: 127.0.0.1
3356+
Server port: 4444
3357+
Working clients: 100
3358+
Working messages: 1000
3359+
Message size: 32
3360+
Seconds to benchmarking: 10
3361+
3362+
Errors: 0
3363+
3364+
Total time: 12.530 s
3365+
Total data: 207.994 MiB
3366+
Total messages: 6814785
3367+
Data throughput: 16.611 MiB/s
3368+
Message latency: 1.838 mcs
3369+
Message throughput: 543858 msg/s
3370+
```
3371+
33273372
### WebSocket echo server
33283373

33293374
* [WsEchoServer](https://github.com/chronoxor/NetCoreServer/blob/master/performance/WsEchoServer/Program.cs)

performance/HttpTraceClient/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void Main(string[] args)
144144
// Disconnect clients
145145
Console.Write("Clients disconnecting...");
146146
foreach (var client in httpClients)
147-
client.Disconnect();
147+
client.DisconnectAsync();
148148
Console.WriteLine("Done!");
149149
foreach (var client in httpClients)
150150
while (client.IsConnected)

performance/HttpsTraceClient/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static void Main(string[] args)
149149
// Disconnect clients
150150
Console.Write("Clients disconnecting...");
151151
foreach (var client in httpsClients)
152-
client.Disconnect();
152+
client.DisconnectAsync();
153153
Console.WriteLine("Done!");
154154
foreach (var client in httpsClients)
155155
while (client.IsConnected)

0 commit comments

Comments
 (0)