lhotari commented on PR #23600:
URL: https://github.com/apache/pulsar/pull/23600#issuecomment-2475922541

   > If any solution from `Fastutil` prove to be more space efficient, i am 
glad to adopt it. Nack Tracker will consume enormous amount of memory, we have 
to choose the best one.
   
   The main purpose of [Fastutil](https://fastutil.di.unimi.it/) is performance 
and space efficiency. 
   Instead of adding very complex keys such as triple keys, there's a chance to 
use a datastructure that is hierarchical. That's the approach I took in the 
PendingAcksMap class:
   
https://github.com/apache/pulsar/blob/3d0625ba64294fb0fe7dafc27c7a34883b4be51b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PendingAcksMap.java#L101
   There's a huge benefit when the keys are primitives and you can only achieve 
that with a hierarchical data structure.
   In the long run, I'd rather get rid of our custom collection implementations 
instead of adding more of them.
   It's not trivial to create bug free collections. Using existing libraries 
for that purpose is strongly preferred.
   
   Have you considered a hierarchical data structure? (such as map of maps)


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