Benchmarked with BenchmarkDotNet library.
GRPC library version: 1.4.1
ASP.NET Core version: 2.0, Newtonsoft.Json: 10.0.3
GRPC: Benchmarked against GRPC server.
Json: Benchmarked against ASP.NET Core 2.0 (Kestrel + MVC framework).
GRPC: .NET Core 2.0 console app.
Json: .NET Core 2.0 console app.
Encoding: UTF8
Formatting: not indented
SmallRequest: 26 chars -> 26 bytes
HugeRequest: 4,828 characters -> 4,828 bytes
BenchmarkDotNet=v0.10.9, OS=Windows 10 Threshold 2 (10.0.10586)
Processor=Intel Core i7-5500U CPU 2.40GHz (Broadwell), ProcessorCount=4
Frequency=2338332 Hz, Resolution=427.6553 ns, Timer=TSC
.NET Core SDK=2.0.0
[Host] : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
DefaultJob : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
Method | Mean | Error | StdDev |
---|---|---|---|
SendSmallRequestToServer | 138.7 us | 2.349 us | 2.082 us |
SendHugeRequestToServer | 277.9 us | 5.124 us | 5.483 us |
BenchmarkDotNet=v0.10.9, OS=Windows 10 Threshold 2 (10.0.10586)
Processor=Intel Core i7-5500U CPU 2.40GHz (Broadwell), ProcessorCount=4
Frequency=2338332 Hz, Resolution=427.6553 ns, Timer=TSC
.NET Core SDK=2.0.0
[Host] : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
DefaultJob : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
Method | Mean | Error | StdDev | Median |
---|---|---|---|---|
SendSmallRequestToServer | 613.5 us | 20.30 us | 56.26 us | 590.5 us |
SendHugeRequestToServer | 964.1 us | 20.12 us | 39.71 us | 950.1 us |
The smaller the better. Y scale is nanosec
The smaller the better. Y scale is nanosec
Open 2 separate command window and run the servers.
cd "Grpc.Json.PerformanceTest\JsonServer"
dotnet run -c Release
cd "Grpc.Json.PerformanceTest\GrpcServer"
dotnet run -c Release
And then the testrunners:
cd "Grpc.Json.PerformanceTest\JsonClient"
dotnet run -c Release
cd "Grpc.Json.PerformanceTest\GrpcClient"
dotnet run -c Release