You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/08/10 11:07:47 UTC

[GitHub] [incubator-brpc] heyuyi0906 commented on pull request #1175: about support protobuf arena

heyuyi0906 commented on pull request #1175:
URL: https://github.com/apache/incubator-brpc/pull/1175#issuecomment-671292722


   在大包情况下,自测发现对于性能提升还是比较明显的。
   support_pb_arena分支测试结果:
   ![image](https://user-images.githubusercontent.com/67617182/89775545-916f7700-daf7-11ea-91cf-0eeb8a941cbe.png)
   master分支测试结果:
   ![image](https://user-images.githubusercontent.com/67617182/89775597-ad731880-daf7-11ea-979c-11ea4bc99907.png)
   
   测试条件:
   机器:8核 Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz
   protobuf版本:v3.6.1
   压测工具:rpc_press thread_num=50
   协议:
   ```
   syntax="proto2";
   package example;
   
   option cc_generic_services = true;
   
   message Obj {
       optional uint64 val = 1;
   };
   
   message EchoRequest {
       required string message = 1;
       repeated double array = 2;
       repeated Obj objs = 3;
   };
   
   message EchoResponse {
       required string message = 1;
       repeated double array = 2;
       repeated Obj objs = 3;
   };
   
   service EchoService {
         rpc Echo(EchoRequest) returns (EchoResponse);
   };
   ```
   server处理逻辑:
   ```
           response->set_message(request->message());
   
           for (int i = 0; i < request->array_size(); ++i) {
               response->add_array(request->array(i));
           }
   
           for (int i = 0; i < request->objs_size(); ++i) {
               auto o = response->add_objs();
               o->set_val(request->objs(i).val());
           }
   ```
   压测input:
   ```
   {
     "message":"xxx......", 
     "array":[2.9,2.9,......],
     "objs":[{"val":10},......]
   }
   ```
   message字符串长度16384
   array包含8192个double
   objs包含8192个对象
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org