You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "dlmarion (via GitHub)" <gi...@apache.org> on 2026/07/07 20:19:10 UTC

[PR] Provide a better initial size for collections if possible [accumulo]

dlmarion opened a new pull request, #6464:
URL: https://github.com/apache/accumulo/pull/6464

   (no comment)


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Provide a better initial size for collections if possible [accumulo]

Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on code in PR #6464:
URL: https://github.com/apache/accumulo/pull/6464#discussion_r3548210071


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/Bulk.java:
##########
@@ -167,13 +167,16 @@ public int hashCode() {
   }
 
   public static class Files implements Iterable<FileInfo> {
-    final Map<String,FileInfo> files = new HashMap<>();
+    final Map<String,FileInfo> files;
 
     public Files(Collection<FileInfo> files) {
+      this.files = new HashMap<>(files.size(), 1.0f);

Review Comment:
   I think the 1.0 load factor prevents resizing until you try to exceed the current size. So this avoids an unnecessary resize as we're filling it up with a known quantity.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Provide a better initial size for collections if possible [accumulo]

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion merged PR #6464:
URL: https://github.com/apache/accumulo/pull/6464


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Provide a better initial size for collections if possible [accumulo]

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #6464:
URL: https://github.com/apache/accumulo/pull/6464#discussion_r3551406143


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/Bulk.java:
##########
@@ -167,13 +167,16 @@ public int hashCode() {
   }
 
   public static class Files implements Iterable<FileInfo> {
-    final Map<String,FileInfo> files = new HashMap<>();
+    final Map<String,FileInfo> files;
 
     public Files(Collection<FileInfo> files) {
+      this.files = new HashMap<>(files.size(), 1.0f);

Review Comment:
   Exactly. If we know the size before-hand, then we can set the collection size appropriately so that it won't resize.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Provide a better initial size for collections if possible [accumulo]

Posted by "ddanielr (via GitHub)" <gi...@apache.org>.
ddanielr commented on code in PR #6464:
URL: https://github.com/apache/accumulo/pull/6464#discussion_r3545976033


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/Bulk.java:
##########
@@ -167,13 +167,16 @@ public int hashCode() {
   }
 
   public static class Files implements Iterable<FileInfo> {
-    final Map<String,FileInfo> files = new HashMap<>();
+    final Map<String,FileInfo> files;
 
     public Files(Collection<FileInfo> files) {
+      this.files = new HashMap<>(files.size(), 1.0f);

Review Comment:
   Why the change from the default `0.75` load factor to `1.0`?
   



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org