-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove fastutil dependency #576
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #576 +/- ##
============================================
- Coverage 51.97% 51.59% -0.38%
- Complexity 6401 6457 +56
============================================
Files 363 367 +4
Lines 37028 37586 +558
Branches 6063 6167 +104
============================================
+ Hits 19244 19394 +150
- Misses 16522 16901 +379
- Partials 1262 1291 +29
... and 5 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Thanks for giving this another go.
I can see that this would be a huge improvement for applications where the size of the resulting jar matters 👍 .
Any reason to use manual shading and not rely on the shading plugin? Benefits would be the ability to follow updates (fastutil seems reasonably stable, but it's still actively maintained), document/reduce code ownership, making it easy to use other classes from fastutil in the future in a consistent way. I haven't used that functionality myself before, so I might overlook some complications. Another solution that gets mentioned in the fastutils issue is using proguard to produce a reduced jar, but I'd rather not make all users depend on a non-standard solution.
That would essentially mean re-implementing fastutil (or the small subset of it that we are using) with our own templating (fastutil is generated using a C-preprocessor based code-generator), right? Do you mean custom-fit in terms of datatypes or in terms of features/performance characteristics? I suspect you have specific improvements in mind? In general this looks good, and I wouldn't be opposed to merging this, either because there are aguments against sharding in the maven step that i'm not aware of or simply because noone has time to implement it and we have a working solution to a real problem here. |
Using the shading plugin would pull in a lot of other classes like It was fairly straight forward to get the lists in, so I don't think adding more classes (e.g. a primitive map) would be that difficult to add later if needed. The basic features of primitive lists are incredibly stable, so I don't expect any significant updates that would need to be backported.
Yes, I was mostly thinking of naming conventions for consistency. There is an argument for keeping it though to simplify pulling in more features if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I added a small notice to the top of the copied files linking to the original project and stating that the files where modified/simplified.
dataset
currently depends onit.unimi.dsi:fastutil
, which adds a ~19MB dependency for 3 classes that are actually being used. After icu4j the total size with dependencies (other than JavaFX) is about ~29MB, so removing it would reduce the total size by 2/3 to below 10MB.In this PR I shaded the fastutil classes and removed some parts that aren't being used (e.g. sorting). Fastutil uses the Apache v2 license, so it could be used as is.
Do you think it'd be worth using the generator to create more custom-fit implementations?