mjsax commented on code in PR #24195:
URL: https://github.com/apache/kafka/pull/24195#discussion_r4570330759


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/AssignmentRefiner.java:
##########
@@ -104,7 +104,8 @@ static boolean preservesActiveTaskCount(
         Map<String, TasksTuple> targetAssignment,
         Map<String, TasksTuple> refinedAssignment
     ) {
-        return countActiveTasks(targetAssignment) == 
countActiveTasks(refinedAssignment);
+        return targetAssignment == refinedAssignment

Review Comment:
   > Is it meant as a fast path for a refiner that returns the target map 
unchanged
   
   Yes, it's minor a side perf improvement for the happy path, not related to 
the epoch bump fix. -- I did not think it's worth do open an extra PR for this 
one-liner... Found this while looking into the comment from Chia-Ping, and if 
we can improve the perf for `differsFromAssignedTasks()`
   
   If you want to get rid of this change in this PR, I can also add it to the 
other PR I plan to do, to make the `differsFromAssignedTasks()` perf 
improvement.
   
   > If we keep it, a short comment saying why would help.
   
   You mean like an inline comment in the code? Or in the PR description?



##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/AssignmentRefiner.java:
##########
@@ -104,7 +104,8 @@ static boolean preservesActiveTaskCount(
         Map<String, TasksTuple> targetAssignment,
         Map<String, TasksTuple> refinedAssignment
     ) {
-        return countActiveTasks(targetAssignment) == 
countActiveTasks(refinedAssignment);
+        return targetAssignment == refinedAssignment

Review Comment:
   Small side perf improvement for the happy path.



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

Reply via email to