nzw921rx opened a new pull request, #12176:
URL: https://github.com/apache/seatunnel/pull/12176

   ### Purpose of this pull request
   
   Reduce lock contention in `ProtoStuffSerializer` schema lookup during 
concurrent serialization and deserialization.
   
   - Set `protostuff.runtime.preserve_null_elements` once during class 
initialization, before the first runtime schema is created, instead of updating 
the global system properties on every schema lookup.
   - Use `SCHEMA_CACHE.get()` for cache hits, avoiding the cache-hit locking in 
Java 8's `ConcurrentHashMap.computeIfAbsent()`.
   - Retain `computeIfAbsent()` for cache misses so schema creation and 
publication remain atomic.
   
   This change is limited to schema lookup; it does not change WAL recovery 
logic.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Public APIs, serialized data format and null-element preservation are 
unchanged.
   
   ### How was this patch tested?
   
   - `./mvnw spotless:apply` — passed.
   - Java 8: `./mvnw -pl 
seatunnel-engine/seatunnel-engine-serializer/serializer-protobuf -am 
-Dtest=ProtoStuffSerializerTest -Dsurefire.failIfNoSpecifiedTests=false test` — 
passed (3 tests).
   - Added concurrent first-use and cache-reuse coverage with eight threads, 
including round trips of payloads containing null list elements. Existing 
array/null-element tests also pass.
   
   ### Before optimization: CPU / Wall / Lock evidence
   
   _To be uploaded._
   
   ### After optimization: Lock evidence — target contention no longer observed
   
   _To be uploaded._
   
   ### Check list
   
   - No new dependencies or binary packages.
   - No configuration, public API or serialized-format changes requiring 
migration documentation.
   


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

Reply via email to