ijuma commented on PR #12967:
URL: https://github.com/apache/kafka/pull/12967#issuecomment-1343464276

   > The data structure is converted to Java's List from scala.
   
   Why is this? Java's `ArrayList` is array backed, just like `ArrayBuffer` 
while `ListBuffer` is a linked list.
   
   Generally, linked lists are worse due to cache effects and `ArrayBuffer` has 
amoritzed constant append too.
   
   One case where `ListBuffer` is better is when `ArrayBuffer` usage results in 
unnecessary allocations (i.e. small lists). A simple way of solving that for 
`ArrayBuffer` is to size the underlying array to be smaller.
   
   I haven't looked at the results in detail yet, but I wanted to share this as 
I am a bit confused about the PR description.


-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to