aokolnychyi commented on code in PR #8336:
URL: https://github.com/apache/iceberg/pull/8336#discussion_r1296205769


##########
core/src/main/java/org/apache/iceberg/util/ArrayUtil.java:
##########
@@ -59,6 +61,14 @@ public static List<Long> toLongList(long[] longs) {
     }
   }
 
+  public static List<Long> toUnmodifiableLongList(long[] longs) {
+    if (longs != null) {
+      return Collections.unmodifiableList(Longs.asList(longs));

Review Comment:
   I am using `Longs.asList()` from Guava instead of Stream + collect as it 
wraps the array directly into a special collection type called 
`LongArrayAsList`, which should generate less garbage and be faster. I noticed 
these calls in flamegraphs.
   
   <img width="2551" alt="image" 
src="https://github.com/apache/iceberg/assets/6235869/8cc8e93e-7c12-4519-8ff4-3f3e42af924a";>
   
   
   
   
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to