Closed RiccoYuan closed 4 years ago
I'll look into your results when I have some time.
Our benchmarks are here: https://msit.powerbi.com/view?r=eyJrIjoiYTZjMTk3YjEtMzQ3Yi00NTI5LTg5ZDItNmUyMGRlOTkwMGRlIiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9
Yellow is Grpc.AspNetCore, blue is Grpc.Core
My guess would be that you haven't disabled logging?
My guess would be that you haven't disabled logging?
Do you mean to disable the default log?
.ConfigureLogging(config => { config.ClearProviders(); })
I disabled the default log and tested it again to get the same result.
These are the results from perf/benchmarkapps/grpcaspnetcoreserver:
Results:
GrpcRaw-UnaryWorker request: 74876
GrpcNetClient-UnaryWorker request: 72917
GrpcNetClient-PingPongStreamingWorker request: 157353
GrpcNetClient-ServerStreamingWorker request: 2681641
JsonRaw request: 75976
JsonMvc request: 65798
GrpcCore-UnaryWorker request: 112321
GrpcCore-ServerStreamingWorker request: 681880
GrpcCore-PingPongStreamingWorker request: 163643
All of these are against the Grpc.AspNetCore
server.
GrpcRaw = using raw HttpClient
to send gRPC
GrpcNetClient = Grpc.Net.Client
GrpcCore = Grpc.Core
JsonRaw = JSON response from a request delegate
JsonMvc = JSON response from MVC/WebAPI
Grpc.Net.Client
has some issues with unary calls but it is still faster than JSON + WebAPI.
Dear all: I am sorry to ask such a question because of my ignorance.
But I did a test to implement a
SayHi
service usingGrpc.AspNetCore
,WebApi
,Grcp.Core
, I tested it multiple times with loop calls and parallel calls. Then I found thatGrpc.AspNetCore
is slower thanWebApi
, andWebApi
is slower thanGrcp.Core
. They are all based on.netcore3.0,
And run in the same configuration of the Docker container, of course, the results of my local development environment test is the same.This is my test program I am a beginner who loves gRPC. I hope someone can answer my confusion. Thanks very much!
The following is my test results: 1000 For loop calls, inside the loop create a new connection each time
1000 For loop calls, only create a connection outside the loop
1000 Parallel parallel calls, here only tested every time a new connection is created