This is an automated email from the ASF dual-hosted git repository. chaokunyang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/fory-site.git
commit 582727ef7030ce40dbeeb1815e2353d9ef18a1cb Author: chaokunyang <[email protected]> AuthorDate: Mon Jun 23 07:35:03 2025 +0000 🔄 synced local 'docs/guide/' with remote 'docs/guide/' --- docs/guide/java_serialization_guide.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/docs/guide/java_serialization_guide.md b/docs/guide/java_serialization_guide.md index 5af400e4..33819ea7 100644 --- a/docs/guide/java_serialization_guide.md +++ b/docs/guide/java_serialization_guide.md @@ -314,7 +314,6 @@ The key difference between these two is that `AbstractCollectionSerializer` can For collection serializer, this is a special parameter `supportCodegenHook` needs be configured: - When `true`: - - Enables optimized access to collection elements and JIT compilation for better performance - Direct serialization invocation and inline for map key-value items without dynamic serializer dispatch cost. - Better performance for standard collection types @@ -487,21 +486,18 @@ class IntListSerializer extends AbstractCollectionSerializer<IntList> { Key Points: 1. **Primitive Array Storage**: - - Uses `int[]` for direct storage - Avoids boxing/unboxing overhead - Provides efficient memory layout - Enables direct array access 2. **Direct Serialization**: - - Write size first - Write primitive values directly - No iteration overhead - No boxing/unboxing during serialization 3. **Direct Deserialization**: - - Read size first - Create primitive array - Read values directly into array @@ -676,21 +672,18 @@ class CustomCollectionSerializer extends AbstractCollectionSerializer<CustomColl Key takeways: 1. **Collection Structure**: - - Array-based storage for elements - Fixed size after creation - Direct element access - Size tracking 2. **View Implementation**: - - Extends `AbstractCollection` for simplicity - Provides iterator for element access - Implements `add()` for deserialization - Shares array reference with original type 3. **Serializer Features**: - - Uses `supportCodegenHook=true` for JIT optimization - Shares array references when possible - Maintains proper size tracking @@ -711,7 +704,6 @@ When implementing a serializer for a custom Map type, you must extend `MapSerial Similiar to collection serializer, this is a special parameter `supportCodegenHook` needs be configured: - When `true`: - - Enables optimized access to map elements and JIT compilation for better performance - Direct serialization invocation and inline for map key-value items without dynamic serializer dispatch cost. - Better performance for standard map types @@ -857,21 +849,18 @@ class FixedValueMapSerializer extends AbstractMapSerializer<FixedValueMap> { Key Points: 1. **Disable Codegen**: - - Set `supportCodegenHook=false` in constructor - Fory will use your `write`/`read` methods directly - No JIT optimization will be applied - Full control over serialization format 2. **Write Method**: - - Handle all serialization manually - Write custom fields first - Write map entries in your preferred format - Control the exact binary layout 3. **Read Method**: - - Handle all deserialization manually - Read in same order as written - Create and populate map instance @@ -892,7 +881,6 @@ When to Use: this approach is best when Trade-offs 1. **Advantages**: - - Complete control over serialization - Custom binary format possible - Simpler implementation for special cases --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
