Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 protobuf 是否可以提高性能?目前,我有几个服务只是传递数据而不做任何转换。使用 Any 类型可以节省序列化/反序列化数据所花费的 cpu 周期吗?
将消息打包在 anAny中将防止刚刚通过它的中间服务打包和解包它。粗略地说,如果序列化+反序列化此消息所需的时间大于序列化+反序列化包含该消息的 Any 所需的时间,那么您可能可以节省一些 CPU 时间,但我建议先测量。
Any