zhan7236 opened a new pull request, #2955:
URL: https://github.com/apache/fory/pull/2955

   ## Why?
   
   The JDK default serialization for `ArrayBlockingQueue` and 
`LinkedBlockingQueue` is inefficient and produces warnings like:
   
   ```text
   WARN ObjectStreamSerializer - class java.util.concurrent.ArrayBlockingQueue 
customized jdk serialization, which is inefficient.
   ```
   
   These blocking queues are commonly used in concurrent applications, and 
optimized serializers will improve performance.
   
   ## What does this PR do?
   
   Add dedicated serializers for `java.util.concurrent.ArrayBlockingQueue` and 
`java.util.concurrent.LinkedBlockingQueue`:
   
   - `ArrayBlockingQueueSerializer`: Extends `ConcurrentCollectionSerializer` 
to handle thread-safe serialization with capacity preservation.
   - `LinkedBlockingQueueSerializer`: Extends `ConcurrentCollectionSerializer` 
to handle thread-safe serialization with capacity preservation.
   
   Both serializers:
   - Use `CollectionSnapshot` for safe concurrent iteration.
   - Preserve queue capacity during serialization/deserialization.
   - Support both serialization and copy operations.
   - Are registered as default serializers in `registerDefaultSerializers()`.
   
   ## Related issues
   
   - Fixes #2663 (partial - blocking queue serializers)
   
   ## Does this PR introduce any user-facing change?
   
   - [ ] Does this PR introduce any public API change?
   - [ ] Does this PR introduce any binary protocol compatibility change?
   
   No public API changes. Users will automatically benefit from optimized 
serialization for `ArrayBlockingQueue` and `LinkedBlockingQueue`.
   
   ## Benchmark
   
   Not applicable - This PR replaces the slow JDK `ObjectStreamSerializer` with 
a specialized binary serializer, which is a well-known performance improvement 
pattern already used for other collection types in this codebase.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to