m-trieu commented on code in PR #28537:
URL: https://github.com/apache/beam/pull/28537#discussion_r1335354124


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java:
##########
@@ -933,13 +905,13 @@ private void process(
     final Windmill.WorkItem workItem = work.getWorkItem();
     final String computationId = computationState.getComputationId();
     final ByteString key = workItem.getKey();
-    work.setState(Work.State.PROCESSING);
+    work.setState(State.PROCESSING);
     {
-      StringBuilder workIdBuilder = new StringBuilder(33);
-      workIdBuilder.append(Long.toHexString(workItem.getShardingKey()));
-      workIdBuilder.append('-');
-      workIdBuilder.append(Long.toHexString(workItem.getWorkToken()));
-      DataflowWorkerLoggingMDC.setWorkId(workIdBuilder.toString());
+      String workIdBuilder =

Review Comment:
   I believe StringBuilder is very useful when concatenating in a loop, for 
simple concatenation the compiler will optimize for us. 
https://dzone.com/articles/string-concatenation-performacne-improvement-in-ja



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