wangjialing218 opened a new pull request #8623:
URL: https://github.com/apache/pulsar/pull/8623


   ### Motivation
   
   Currently `PublishRateLimiterImpl` is used for broker publisher throttling, 
and checkPublishRate() is called in high frequency (default is 50ms every 
time). Each time checkPublishRate() is called, `currentPublishByteCount.sum()` 
and `currentPublishMsgCount.sum()` are executed. `LongAdder.sum()` will sum all 
cells in the LongAdder object. 
   In case of only byte throttling (or msg count throttling) is enabled, only 
do the necessary sum operation could improve the performace.
   
   ### Modifications
   In case of only byte throttling (or msg count throttling) is enabled, only 
do the necessary sum operation.
   
   ### Verifying this change
   Already coverd by PublishRateLimiterTest()


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to