-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Search before reporting
- I searched in the 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.
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!