Description
Kafka Java client RecordAccumulator uses a thread to manage and send batches as they are ready. The algorithm in both ready() and drain() use slightly more locking than strictly necessary, which holds up the producer thread from writing to batch.
By reducing the code executed in the lock, we see a 11% reduction in spin-loop lock-related CPU in the producer threads (as they wait for an available batch to append).
Attachments
Issue Links
- links to