wollowizard commented on code in PR #34873:
URL: https://github.com/apache/beam/pull/34873#discussion_r2081239744


##########
sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/coders/AvroCoder.java:
##########
@@ -840,4 +843,38 @@ public boolean equals(@Nullable Object other) {
   public int hashCode() {
     return Objects.hash(getClass(), typeDescriptor, datumFactory, 
schemaSupplier.get());
   }
+
+  private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {

Review Comment:
   @scwhittle yes I could test it with realistic data, and it works as expected.
   
   **AvroDatumFactory**
   before: 32%
   after: 0.036%
   
   **AvroCoder**
   before: 69%
   after: 11%
   
   
   As we thought, this improves not only user code, but also sdk performance.
   Example taken from another pipeline:
   
**org.apache.beam.runners.dataflow.worker.StreamingModeExecutionContext.flushState()**
   before: 43%
   after: 10%
   
   
   **Before**
   
   <img width="600" alt="image" 
src="https://github.com/user-attachments/assets/b121e360-79c9-4fbd-b9d9-079ed9ad50c3";
 />
   <img width="600" alt="image" 
src="https://github.com/user-attachments/assets/3a0e3651-c5f3-4d0b-a2ef-87ec61733bfe";
 />
   <img width="600" alt="image" 
src="https://github.com/user-attachments/assets/6173ea0e-a9b6-4a23-9653-d62df14ef61e";
 />
   
   
   
   
   
   **After**
   
   <img width="600" alt="image" 
src="https://github.com/user-attachments/assets/a33c71f6-af23-481e-a721-5fb272161e67";
 />
   <img width="600" alt="image" 
src="https://github.com/user-attachments/assets/31ee28a8-637c-4bd6-a95e-7eca0b19040b";
 />
   <img width="600" alt="image" 
src="https://github.com/user-attachments/assets/ae1516dc-d23a-4857-ae09-e2c28e4977a0";
 />
   
   
   



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