netudima commented on code in PR #4538:
URL: https://github.com/apache/cassandra/pull/4538#discussion_r2637180639


##########
src/java/org/apache/cassandra/db/Columns.java:
##########
@@ -426,6 +427,11 @@ public void apply(Consumer<ColumnMetadata> function)
         BTree.apply(columns, function);
     }
 
+    public <V> void apply(BiConsumer<V, ColumnMetadata> function, V argument)

Review Comment:
   the idea was to avoid BTree iterator allocation 
`AbstractMemtable.ColumnsCollector#update(org.apache.cassandra.db.RegularAndStaticColumns)`
 using the apply method logic. At the same time I worried about introducing a 
capturing lambda as an extra allocation.
   
   But, I've decided to re-check if a non-static method reference works as a 
capturing lambda and apparently it is not, I do not see an allocation in 
profiles if I use a method reference. So, I can just use the existing apply 
method without an extra argument and introducing of apply with an argument is 
not needed to solve the current issue.



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