tjiuming commented on PR #15033:
URL: https://github.com/apache/pulsar/pull/15033#issuecomment-1252683428

   @merlimat 
   Yes, there is allocator synchronization, but in 
`ProducerImpl#sendAsync(Message<?> message, SendCallback callback)`:
      ```
               try {
               synchronized (this) {
                 ......
               }
           } catch (PulsarClientException e) {
                ......
           } catch (Throwable t) {
               ......
           }
      ``` 
    which means for a Producer, only 1 thread could send message at the same 
time, I think even there is allocator synchronization, it wouldn't have a 
significant large impact.
   
   > Scattered write on the socket from many small buffers
   
   For this part, I don't think it will make a big difference. Yes, read bytes 
from `CompositeByteBuf` is truly slower than 1 single large buffer, because it 
need to calculate the `readerIndex`, but when write it to channel, 
`CompositeByteBuf` will transfer to `ByteBuffer[]`, it would not too much 
slower than `ByteBuffer`.


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

Reply via email to