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

   This PR optimized the refiner() performance, in particular the "happy path",
   ie, a STABLE heartbeat with no new assignment or refinement step.
   
   1. Removes an expensive assignment check for all members
   2. Avoids an expensive refiner-cache write
   
   This PR also adds `StreamsGroupHeartbeatBenchmark` (JMH). It builds a
   group through the coordinator: every member joins with a heartbeat, one
   initial rebalance assigns all of them, and the members heartbeat,
   acknowledging their tasks, until a whole round writes no records. It
   checks that all active and standby tasks are assigned and that the group
   is stable before measuring:
   
   Median time per operation, 5 active tasks per member, no standby
   replicas, default configuration (NoOp refiner, 2 warm-up replicas),
   before -> after:
   
   ```
   | Members | Stable heartbeat  | Replay of the group's records |
   |---------|-------------------|-------------------------------|
   | 100     | 9.7 us -> 0.22 us | 64 us -> 93 us                |
   | 1000    | 118 us -> 0.28 us | 704 us -> 1025 us             |
   | 4000    | 605 us -> 0.32 us | 3.5 ms -> 5.7 ms              |
   ```
   
   Replaying the group's records is slower because the coordinator now
   compares a member's assigned tasks with its target assignment once per
   current-assignment or target-assignment record, and updates the set; a
   member-metadata record is skipped by a reference check. That is a cost
   per record, paid when a group is loaded or a record is written, against
   the cost per stable heartbeat it removes.
   


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