fzhedu commented on issue #2052:
URL: 
https://github.com/apache/incubator-brpc/issues/2052#issuecomment-1369506674

   @leaf-potato 感谢您的回复。Q2 已经没疑问了,但是 Q1 中关于用 iobuf 和直接 chunkPB 
传输的性能方面还有疑问,因为我们传输的是 chunkPB list,它由多个 chunkPB 组成,可以直接传输 chunkPB 
list。如果用IObuf,现有 Starrocks 中将 chunkPB list 中的每个 chunkPB copy 到 IOBuf 
中进行发送;接受端则需要从 IObuf 中 copy 出 chunkPB。在发送和接受端各有一次 copy,这个代价使得 IObuf 应该会慢一些。同时考虑到 
IOBuf 不限制发送数据量的优势,因此我们做出一些优化:
   1. 针对接受端,使用 cut() 函数避免 copy,直接引用 iobuf 中的数据来 deserialize,避免原来的 copy;
   2. 针对发送端,当发送数据量< 2G,则直接传 serialize 的 chunkPB list,不然则 copy 到 iobuf。
   
   也就是发送数据量 >=2G 的时候在发送端的 copy 无法消除,其他的 copy 都可以消除,这样可以更高效。
   
   此外还有个问题请教一下:
   
   Q3:通过 perf,我们看到 bthread 中的 sys call 占总体 sys call 的 20% 
左右,不知道是我们使用姿势有问题,或者是有优化参数可以控制?
   
   
   
![image](https://user-images.githubusercontent.com/6490813/210322342-3b8dc18b-8774-47b7-bf6b-09594ddb5b24.png)
   


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

Reply via email to