lucasbru opened a new pull request, #12808: URL: https://github.com/apache/kafka/pull/12808
The state updater code path introduced allocation and synchronization overhead by performing relatively heavy operations in every iteration of the `StreamThread` loop. This includes various allocations and acquiring locks for handling `removedTasks` and `failedTasks`, even if the corresponding queues are empty. This change introduces `hasRemovedTasks` and `hasExceptionsAndFailedTasks` in the `StateUpdater` interface that can be used to skip over any allocation or synchronization. The new methods do not require synchronization or memory allocation. We extend existing unit tests to cover the slightly modified behaviour. The change was also benchmarked (on top of other changes for KAFKA-14299) and increased throughput by ~15% in this one (state heavy) benchmark. ### Committer Checklist (excluded from commit message) - [x] Verify design and implementation - [x] Verify test coverage and CI build status - [x] Verify documentation (including upgrade notes) -- 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