nfsantos commented on code in PR #2146:
URL: https://github.com/apache/jackrabbit-oak/pull/2146#discussion_r1984732567


##########
oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/PropertyStates.java:
##########
@@ -89,7 +90,7 @@ public static PropertyState createProperty(
             String name, Iterable<Value> values)
             throws RepositoryException {
         int type = PropertyType.STRING;
-        Value first = Iterables.getFirst(values, null);
+        Value first = StreamUtils.toStream(values).findFirst().orElse(null);

Review Comment:
    @rishabhdaim, thanks for micro benchmark results. Could you reformat them 
so they are easier to read? 
    
    If I understood correctly, the longest iteration repeated the operation 
10000 times, right? This is not much, it would be better to run for at least a 
few seconds to give time for the JIT to quick in.
    
    But sounds good to use `commons-collections4` if its performance is 
equivalent to Guava's. 



-- 
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: oak-dev-unsubscr...@jackrabbit.apache.org

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

Reply via email to