protocol buffers - Zero Copy bytes in grpc c++ -
i started use grpc, , noticed bytes in c++ compiled std::string
, means every grpc object arrives @ service needs copied new buffer because of std::string
ownership.
i don't want copy every object new buffer before using (too many allocations).
is there known solution, or using grpc wrong?
grpc uses protobufs. can move stuff out of protobuf message
calling generated release_xxx()
methods.
string* release_foo()
: releases ownership of field , returns pointer ofstring
object. after calling this, caller takes ownership of allocatedstring
object ,foo()
return empty string/empty bytes.
https://developers.google.com/protocol-buffers/docs/reference/cpp-generated
Comments
Post a Comment