LuciferYang commented on code in PR #49826: URL: https://github.com/apache/spark/pull/49826#discussion_r1944297105
########## launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java: ########## @@ -46,24 +47,15 @@ static boolean isEmpty(String s) { /** Joins a list of strings using the given separator. */ static String join(String sep, String... elements) { - StringBuilder sb = new StringBuilder(); - for (String e : elements) { - if (e != null) { - if (sb.length() > 0) { - sb.append(sep); - } - sb.append(e); - } - } - return sb.toString(); + return join(sep, Arrays.stream(elements).toList()); Review Comment: IIRC, in relatively simple computing scenarios, `Arrays.stream` is expected to be slower than the existing implementation. Has its performance improved now? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org