First build with some raw tests. There are probably still a lot of places performance can be optimized, take the results with two grains of salt!
Benchmark Results
Linux Setup
- OS: Ubuntu 20.04.1 LTS
- CPU: Intel® Core™ i5-3570K CPU @ 3.40GHz × 4
- Mainboard: Gigabyte Z77X-D3H Gb LAN (Atheros)
- RAM: G.Skill 16GB (2 x 8 GB) DDR3-1600 (Part number: F3-1600C11-8GNT)
Benchmark 1 (v 0.1.0)
- OS: Linux 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 X64
- Framework: .NET Core 3.1.8
- Test: PingPong
- Address: 127.0.0.1, Port: 3333
- Number of clients: 1000
- Parallel messages per client: 1
- Message size: 32 bytes
- Defined duration: 60 seconds
ENet
Duration: 60.014 s
Messages sent by clients: 11,753,452
Messages server received: 11,753,455
Messages sent by server: 11,753,455
Messages clients received: 11,753,452
Total data: 358.69 MB
Data throughput: 5.98 MB/s
Message throughput: 195,845 msg/s
Message latency: 5.106 μs
NetCoreServer
Duration: 60.006 s
Messages sent by clients: 6,547,612
Messages server received: 6,546,729
Messages sent by server: 6,546,728
Messages clients received: 6,546,620
Total data: 199.79 MB
Data throughput: 3.33 MB/s
Message throughput: 109,100 msg/s
Message latency: 9.166 μs
Benchmark 2 (v 0.1.0)
- OS: Linux 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 X64
- Framework: .NET Core 3.1.8
- Test: PingPong
- Address: 127.0.0.1, Port: 3333
- Number of clients: 100
- Parallel messages per client: 1,000
- Message size: 32 bytes
- Defined duration: 60 seconds
ENet
Duration: 60.009 s
Messages sent by clients: 130,768,872
Messages server received: 130,770,536
Messages sent by server: 130,770,536
Messages clients received: 130,768,872
Total data: 3990.75 MB
Data throughput: 66.50 MB/s
Message throughput: 2,179,168 msg/s
Message latency: 0.459 μs
NetCoreServer
Duration: 60.602 s
Messages sent by clients: 7,222,248
Messages server received: 7,124,206
Messages sent by server: 7,124,205
Messages clients received: 7,123,023
Total data: 217.38 MB
Data throughput: 3.59 MB/s
Message throughput: 117,538 msg/s
Message latency: 8.508 μs
Windows Setup
- OS: Windows 10 Pro 2004 x64 (v10.0.19041)
- CPU: AMD Ryzen 7 3700X 3.6 GHz 8-Core
- Mainboard: MSI MAG X570 TOMAHAWK WIFI ATX AM4 Lan: 2.5 Gbit/s
- RAM: G.Skill Aegis 32 GB (2 x 16 GB) DDR4-3200 CL16
Complete Build
Benchmark 1 (v 0.1.0)
- OS: Microsoft Windows 10.0.19041 X64
- Framework: .NET Core 3.1.8
- Test: PingPong
- Address: 127.0.0.1, Port: 3333
- Number of clients: 1000
- Parallel messages per client: 1
- Message size: 32 bytes
- Defined duration: 60 seconds
ENet
Duration: 60,004 s
Messages sent by clients: 1.584.735
Messages server received: 1.585.734
Messages sent by server: 1.585.734
Messages clients received: 1.584.735
Total data: 48,36 MB
Data throughput: 0,81 MB/s
Message throughput: 26.411 msg/s
Message latency: 37,864 µs
NetCoreServer
Duration: 60,040 s
Messages sent by clients: 4.156.889
Messages server received: 4.156.127
Messages sent by server: 4.156.126
Messages clients received: 4.155.989
Total data: 126,83 MB
Data throughput: 2,11 MB/s
Message throughput: 69.221 msg/s
Message latency: 14,447 µs
Benchmark 2 (v 0.1.0)
- OS: Microsoft Windows 10.0.19041 X64
- Framework: .NET Core 3.1.8
- Test: PingPong
- Address: 127.0.0.1, Port: 3333
- Number of clients: 100
- Parallel messages per client: 1.000
- Message size: 32 bytes
- Defined duration: 60 seconds
ENet
Duration: 60,015 s
Messages sent by clients: 83.344.879
Messages server received: 83.344.880
Messages sent by server: 83.344.880
Messages clients received: 83.344.879
Total data: 2543,48 MB
Data throughput: 42,38 MB/s
Message throughput: 1.388.738 msg/s
Message latency: 0,720 µs
NetCoreServer
Duration: 60,385 s
Messages sent by clients: 4.451.909
Messages server received: 4.352.375
Messages sent by server: 4.352.374
Messages clients received: 4.352.163
Total data: 132,82 MB
Data throughput: 2,20 MB/s
Message throughput: 72.074 msg/s
Message latency: 13,875 µs