You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "sjhajharia (via GitHub)" <gi...@apache.org> on 2025/05/23 04:06:41 UTC

[PR] Cleanup JMH-Benchmarks Module [kafka]

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

   Now that Kafka supports Java 17, this PR makes some changes in jmh-benchmarks module. The changes mostly include:
   - Collections.emptyList(), Collections.singletonList() and Arrays.asList() are replaced with List.of()
   - Collections.emptyMap() and Collections.singletonMap() are replaced with Map.of()
   - Collections.singleton() is replaced with Set.of()


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #19791:
URL: https://github.com/apache/kafka/pull/19791


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on PR #19791:
URL: https://github.com/apache/kafka/pull/19791#issuecomment-2944068063

   Gentle reminder
   @frankvicky @chia7712 
   


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on PR #19791:
URL: https://github.com/apache/kafka/pull/19791#issuecomment-3024101807

   Hey @chia7712 
   Gentle reminder!


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on PR #19791:
URL: https://github.com/apache/kafka/pull/19791#issuecomment-2905251231

   Thanks @Yunyung for the review. I have addressed the comment. 
   PTAL when possible!


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on code in PR #19791:
URL: https://github.com/apache/kafka/pull/19791#discussion_r2106058418


##########
jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java:
##########
@@ -189,7 +187,7 @@ private Optional<String> rackId(int memberIndex) {
     private static Map<Integer, Set<String>> mkMapOfPartitionRacks(int numPartitions) {

Review Comment:
   this `mkMapOfPartitionRacks` method is unused, we should remove it.



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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #19791:
URL: https://github.com/apache/kafka/pull/19791#discussion_r2160075084


##########
jmh-benchmarks/src/main/java/org/apache/kafka/jmh/core/TestPurgatoryPerformance.java:
##########
@@ -313,7 +313,7 @@ public long next() {
         }
 
         public void printStats() {
-            List<Long> samples = this.samples.stream().sorted().collect(Collectors.toList());
+            List<Long> samples = this.samples.stream().sorted().toList();

Review Comment:
   could you please replace `collect(Collectors.toList())` by `toList` for whole jmh module?



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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on PR #19791:
URL: https://github.com/apache/kafka/pull/19791#issuecomment-2924430980

   Hey @frankvicky 
   If you can pls have a look at this PR too.


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on PR #19791:
URL: https://github.com/apache/kafka/pull/19791#issuecomment-2909416974

   Hey @m1a2st 
   I have updated the PR


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on PR #19791:
URL: https://github.com/apache/kafka/pull/19791#issuecomment-2915729538

   cc: @frankvicky 


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on PR #19791:
URL: https://github.com/apache/kafka/pull/19791#issuecomment-2908408215

   Please resolve the conflict, thanks


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "Yunyung (via GitHub)" <gi...@apache.org>.
Yunyung commented on PR #19791:
URL: https://github.com/apache/kafka/pull/19791#issuecomment-2904765961

   Thanks for the PR. Could you also do this cleanup?
   Collections.unmodifiableMap -> Map.copyOf


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on code in PR #19791:
URL: https://github.com/apache/kafka/pull/19791#discussion_r2160087650


##########
jmh-benchmarks/src/main/java/org/apache/kafka/jmh/core/TestPurgatoryPerformance.java:
##########
@@ -313,7 +313,7 @@ public long next() {
         }
 
         public void printStats() {
-            List<Long> samples = this.samples.stream().sorted().collect(Collectors.toList());
+            List<Long> samples = this.samples.stream().sorted().toList();

Review Comment:
   Thanks @chia7712 for the review. 
   Addressed the same in the latest commit. PTAL when possible.



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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on PR #19791:
URL: https://github.com/apache/kafka/pull/19791#issuecomment-2961221581

   Gentle reminder @chia7712 @frankvicky 


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


Re: [PR] MINOR: Cleanup JMH-Benchmarks Module [kafka]

Posted by "Yunyung (via GitHub)" <gi...@apache.org>.
Yunyung commented on code in PR #19791:
URL: https://github.com/apache/kafka/pull/19791#discussion_r2106118300


##########
jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java:
##########
@@ -189,7 +187,7 @@ private Optional<String> rackId(int memberIndex) {
     private static Map<Integer, Set<String>> mkMapOfPartitionRacks(int numPartitions) {

Review Comment:
   mkMapOfPartitionRacks will be removed all at once in #19797, so it's fine here.



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