AndrewJSchofield commented on PR #20324: URL: https://github.com/apache/kafka/pull/20324#issuecomment-3257648976
> I'd like to realign the core conversation to the approach in this PR (and #20363) which is the elimination of `addAndGet()` on the common path. The performance bottleneck in `AsyncKafkaConsumer.poll()` is `addAndGet()`, pure and simple. When the application thread calls `addAndGet()` on the common path in `poll()`, the CPU usage spikes. I'm convinced that we can remove calls to `addAndGet()` from the common path in `poll()` through smart and careful sharing of state. I agree with this, but I should point of that it's going to be quite a big shift. In the share consumer, we do have an event to begin fetching, but the background thread just continues to fetch until it receives data. It doesn't need to be repeatedly prodded. We also do not have events for messing around with the position. The background thread could be a bit more autonomous with less requirement to give it synchronous pieces of work to do. -- 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