GitHub user berg223 edited a discussion: Should we continue to use 
ConcurrentLongHashMap in source code?

I have write a 
[benchmark](https://github.com/berg223/BenchMark/blob/main/src/main/java/apache/pulsar/map/BenchMarkRunner.java)
 for ConcurrentLongHashMap and ConcurrentHashMap. And the result shows 
ConcurrentHashMap has about twice throughput than ConcurrentLongHashMap. 
However, there is a tradeoff that ConcurrentHashMap do have more gc count. 

I have upload the benchmark result in attachment file 
[benchmark-concurrent-hashmap.json](https://github.com/user-attachments/files/25598801/benchmark-concurrent-hashmap.json).
 You can visialize the result in [JMH Visualizer](https://jmh.morethan.io/).

**My question: Is ConcurrentLongHashMap a better choice than ConcurrentHashMap? 
Should we continue to use ConcurrentLongHashMap in source code?**

GitHub link: https://github.com/apache/pulsar/discussions/25271

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to