leaf-potato commented on issue #2052: URL: https://github.com/apache/incubator-brpc/issues/2052#issuecomment-1369923528
> 也就是发送数据量 >=2G 的时候在发送端的 copy 无法消除,其他的 copy 都可以消除,这样可以更高效。 我理解不管使用PB还是attachment发送数据都会涉及到一次拷贝,只是这个拷贝发生的地方不同: 1. PB发送数据:用户设置PB => PB序列化(框架)=> 发送。拷贝发生在框架拿到PB序列化的结果。 2. attachment:用户PB序列化 => attachment => 发送。拷贝发生在用户序列化PB给attachment赋值。 > 在限制范围内,attachment和proto的区别在于序列化和反序列化,如果attachment是传proto序列化后的数据,理论上两者差距不大。 综上,用户更多考虑的是如何给PB赋值时减少拷贝,比方使用PB的Swap方法进行数据交换等。最终得@wwbmmm来double check下避免得出错误结论~ -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
