lukecwik commented on code in PR #25186:
URL: https://github.com/apache/beam/pull/25186#discussion_r1099015350


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/logging/BeamFnLoggingClient.java:
##########
@@ -122,7 +124,9 @@ public BeamFnLoggingClient(
     logRecordHandler.setLevel(Level.ALL);
     logRecordHandler.setFormatter(DEFAULT_FORMATTER);
     
logRecordHandler.executeOn(options.as(ExecutorOptions.class).getScheduledExecutorService());
-    outboundObserver = (CallStreamObserver<BeamFnApi.LogEntry.List>) 
stub.logging(inboundObserver);
+    outboundObserver =
+        new DirectStreamObserver<BeamFnApi.LogEntry.List>(
+            phaser, (CallStreamObserver<BeamFnApi.LogEntry.List>) 
stub.logging(inboundObserver));

Review Comment:
   Checked performance impact, seems like we get a net win since we do the 
readiness checking less often
   
   before:
   ```
   Benchmark                                                           Mode  
Cnt       Score       Error  Units
   BeamFnLoggingClientBenchmark.testLogging                           thrpt   
15  415642.810 ± 17448.195  ops/s
   BeamFnLoggingClientBenchmark.testLoggingWithAllOptionalParameters  thrpt   
15  380592.277 ±  8459.947  ops/s
   ```
   
   after:
   ```
   Benchmark                                                           Mode  
Cnt       Score       Error  Units
   BeamFnLoggingClientBenchmark.testLogging                           thrpt   
15  418828.259 ± 15726.823  ops/s
   BeamFnLoggingClientBenchmark.testLoggingWithAllOptionalParameters  thrpt   
15  402892.740 ± 10908.775  ops/s
   ```



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