AnonHxy commented on PR #15033: URL: https://github.com/apache/pulsar/pull/15033#issuecomment-1257222675
I have tested this feature using standalone cluster. It seems that this PR may bring a performance regression. The reason is that: When using `ByteBufAllocator#buffer(int)`, the Bytebuf writing took only a little cpu time: <img width="1919" alt="image" src="https://user-images.githubusercontent.com/10233437/192152190-853d90a2-1cff-45c3-be94-eadba98914fd.png"> And when we using `ByteBufAllocator#compositeBuffer`, the Bytebuf wrte took more cpu time: <img width="1919" alt="image" src="https://user-images.githubusercontent.com/10233437/192152247-2edf193a-02c5-408a-a86e-bc0a4a029eab.png"> I think another solution is that we can introduce a way to shrink the `maxBatchSize`. For example, if current batch size is less that `3/4 * maxBatchSize` we will let `maxBatchSize = 3/4 * maxBatchSize` @merlimat @tjiuming @Jason918 @codelipenghui -- 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]
