You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/11/23 14:53:33 UTC

[GitHub] [kafka] divijvaidya opened a new pull request, #12900: MINOR: Improve Scala collection usage

divijvaidya opened a new pull request, #12900:
URL: https://github.com/apache/kafka/pull/12900

   Multiple changes to improve performance of Scala collection in the code. 
   
   Some examples of improvements include:
   1. filtering before sorting instead of sorting and then filtering
   2. use sortBy instead of sortWith when comparison is based on same property
   3. replace `count(p) == 0` with `!exists(p)`
   
   The changes are partially based on recommendations at: https://pavelfatin.com/scala-collections-tips-and-tricks/ 
   
   


-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] mimaison merged pull request #12900: MINOR: Improve Scala collection usage

Posted by GitBox <gi...@apache.org>.
mimaison merged PR #12900:
URL: https://github.com/apache/kafka/pull/12900


-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] divijvaidya commented on pull request #12900: MINOR: Improve Scala collection usage

Posted by GitBox <gi...@apache.org>.
divijvaidya commented on PR #12900:
URL: https://github.com/apache/kafka/pull/12900#issuecomment-1325228855

   @mdedetrich I believe that you are somewhat of an expert in scala? Mind looking at this PR please?


-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] divijvaidya commented on pull request #12900: MINOR: Improve Scala collection usage

Posted by GitBox <gi...@apache.org>.
divijvaidya commented on PR #12900:
URL: https://github.com/apache/kafka/pull/12900#issuecomment-1326457410

   > Were these suggestions generated through some sort of a tool?
   
   No. I checked them manually. This came up while I was trying to find optimisation opportunities for toSet scala operation in a hot path of the code. 


-- 
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-unsubscribe@kafka.apache.org

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