Hello everyone, Recently, while investigation the...
# dev
r
Hello everyone, Recently, while investigation the UnAckedMessageTracker, I noticed that when user calls the consumer.acknowledgeCumulative() method, it iterates through all the elements in the UnAckedMessageTracker.messageIdPartitionMap. When there are many elements in the map, the performance might be poor. I plan to change the data structure of UnAckedMessageTracker.messageIdPartitionMap from a HashMap to an Object2ObjectSortedMap, and make this configurable when the consumer type is Exclusive. This way, when consumer.acknowledgeCumulative() is called, it wonโ€™t be necessary to iterate through all the elements in UnAckedMessageTracker.messageIdPartitionMap, which could significantly improve performance. However, this change would also make the UnAckedMessageTracker.add() method slightly slower than before. Before I proceed with this implementation, Iโ€™d like to hear your thoughts and suggestions. Thanks!
@Lari Hotari @Penghui Hi, what do you think , any suggestions?
l
makes sense
having some JMH benchmarks to validate performance could also be useful, those could be added to the microbench module which has JMH configuration
๐Ÿ‘ 2
p
Sounds good.
๐Ÿ‘ 1
r
Yes, I've already run some benchmarks locally and the initial results look positive. I plan to submit a PR and will include the benchmark results.
๐Ÿ‘ 1