zhuangchong commented on a change in pull request #4896:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/4896#discussion_r584099105



##########
File path: 
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/CollectionUtils.java
##########
@@ -103,7 +109,8 @@ public static boolean isEmpty(Collection coll) {
             return emptyMap;
         }
         String[] strings = str.split(separator);
-        Map<String, String> map = new HashMap<>(strings.length);
+        int initialCapacity = (int)(strings.length / DEFAULT_LOAD_FACTOR) + 1;
+        Map<String, String> map = new HashMap<>(initialCapacity);

Review comment:
       This change is to reduce the automatic scaling of the HashMap to get the 
maximum initial capacity based on the specified storage capacity and load 
factor.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to