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 2019/07/31 06:22:53 UTC

[GitHub] [incubator-brpc] gxkevin opened a new issue #865: 如何更改baidu_rpc_protocol.cpp,支持objectpool()

gxkevin opened a new issue #865: 如何更改baidu_rpc_protocol.cpp,支持objectpool()
URL: https://github.com/apache/incubator-brpc/issues/865
 
 
      源码如下,想Message req、Message res设置为object pool,减少parse的时候,内存拷贝、delete的时间开销:
        void ProcessRpcRequest(InputMessageBase* msg_base) {
            std::unique_ptr<google::protobuf::Message> req;
            std::unique_ptr<google::protobuf::Message> res;
   
           ret.reset(svc->GetRequestPrototype(method).New());
           res.reset(svc->GetResponsePrototype(method).New());
   
   但是直接通过下面的设置有问题
       google::protobuf::Message *req = butil::get_object<google::protobuf::Message>();
       google::protobuf::Message *res = butil::get_object<google::protobuf::Message>();

----------------------------------------------------------------
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


With regards,
Apache Git Services

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