asafm commented on PR #15558:
URL: https://github.com/apache/pulsar/pull/15558#issuecomment-1162169821

   I definitely agree that for the developer you'll be spending more time 
writing this and checking for collisions, and maybe printing from one class one 
variable and then another class same variable, but you will obtain the end 
result of not increasing memory allocations. The more I read into Pulsar 
metrics code, the more I see techniques used to decrease memory allocations. 
Just today I saw in TransactionsAggregator that they avoid allocating objects 
and keeping the object in ThreadLocal and reset it every time they need it, 
like object pool, but with a fixed size (number of threads). 
   
   I guess @merlimat and @codelipenghui can contribute their knowledge here on 
how important that is, as I'm fairly new to this project.
   


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