feat(java): add fast util serializers#3154
Closed
Pigsy-Monk wants to merge 1 commit intoapache:mainfrom
Closed
Conversation
c2ae53d to
ea4aa17
Compare
Collaborator
|
@Pigsy-Monk Thanks for contributing this feature. But we can't merge this. We're working hard to minimize our library size, we can't introduce a new dependency. |
Contributor
Author
|
Hi, the dependency to fast util is only for test. And so the scope of dependency is also for test only. And I found it's already in fory-testsuite module. I can move the two tests there and leave the code in fory-core . @chaokunyang |
Collaborator
|
We have no plans to introduce serializer for third party serializers in fory-core currently. You can publish a separate jar for those serializer by yourself. Or implement Externalizable for those types in fast util directly. Fory has excellent performance for Externalizable too. |
Contributor
Author
|
Ok I see thanks for replying. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
FastUtilSerializer provides optimized serialization for fastutil collections (such as
ShortOpenHashSet,ShortArrayList, etc.), which are commonly used in high-performance applications. However, the existing implementation lacked comprehensive unit tests and performance benchmarks to validate its correctness and demonstrate the optimization benefits.This PR adds:
FastUtilSerializerto ensure correctnessFastUtilSerializerwith Fory's default serializerShortSetserializationWhat does this PR do?
1. Added Test Dependencies
fastutil(version 8.5.6) as a test dependency infory-core/pom.xml2. Created Unit Tests (
FastUtilSerializerTest.java)Comprehensive test coverage including:
testShortOpenHashSet- Tests serialization/deserialization ofShortOpenHashSettestShortArrayList- TestsShortArrayListserializationtestIntArrayList,testLongArrayList,testByteArrayList- Tests for various primitive array liststestObject2ObjectOpenHashMap- Tests map serializationtestRegisterAll- Tests theregisterAll()method3. Created Performance Tests (
FastUtilShortSetPerformanceTest.java)Performance comparison tests that demonstrate:
4. Test Results
The performance tests validate that:
Related issues