eolivelli commented on a change in pull request #10762:
URL: https://github.com/apache/pulsar/pull/10762#discussion_r651649787



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java
##########
@@ -142,6 +142,14 @@ public synchronized void removeConsumer(Consumer consumer) 
throws BrokerServiceE
                 }
             };
 
+    private static final FastThreadLocal<Map<Consumer, Set<Integer>>> 
localConsumerStickyKeyHashesMap =

Review comment:
       why do we need this ThreadLocal ?
   here we are recycling a simple HashMap
   
   we are "saving" a "new HashMap" and in order to do it we are adding more 
code and memory footprint.
   The JVM should be able to handle this HashMap efficiently, probably within 
the TLAB 
   
   do you have evidence that this threadlocal helps ?
   




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