jdimeo opened a new issue, #24996:
URL: https://github.com/apache/pulsar/issues/24996

   ### Search before reporting
   
   - [x] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Motivation
   
   Pulsar uses `fastutil` for high performance collections. This .jar is around 
25 MB because of specialization, handling all the permutations of primitive 
combinations for the data structures. Pulsar **client** only uses `fastutil` in 
one place- [tracking 
nacks](https://github.com/apache/pulsar/blob/633d19ee31c0de9c938f089c99570d716291239c/pulsar-client/src/main/java/org/apache/pulsar/client/impl/NegativeAcksTracker.java#L25).
   
   When using the packaged/shaded client, only the referenced classes are 
included. However, we prefer to use the `-original` client so we can manage 
transitive dependency versions and not include them redundantly when they were 
already on our classpath. This helps control the overall packaged/shaded size 
of our deployments. 
   
   However, `fastutil`, un-minimized, blows up our packaging size and exceeds 
the unzipped size of AWS Lambda, etc. Someone has packaged up subsets of 
`fastutil` into "bite sized pieces" and uploaded them to Maven:
   
https://mvnrepository.com/artifact/com.nukkitx.fastutil/fastutil-long-object-maps
   
   We are now using Maven to exclude `fastutil` and include this library 
instead. Can Pulsar consider making `-original` projects dependent on this 
"only what's needed" `fastutil` variant instead of the original "kitchen sink" 
one? 
   
   ### Solution
   
   Don't depend on the full `fastutil` from `-original` modules in Pulsar. Use 
https://mvnrepository.com/artifact/com.nukkitx.fastutil/fastutil-long-object-maps
 instead.
   
   ### Alternatives
   
   Refactor `NegativeAcksTracker` to not require `fastutil`. I understand the 
need on the server side/in the broker, but does client code require a 25 MB 
dependency just in this one location?
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


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