conduktor.io ↗

KIP-872 — Add Serializer#serializeToByteBuffer() to reduce memory copying

Accepted ClientProducer

Adds Serializer#serializeToByteBuffer() as a default method returning ByteBuffer, enabling zero-copy serialization for types backed by ByteBuffer and eliminating the intermediate byte[] allocation and wrapping in KafkaProducer#doSend(). The current path always allocates a byte[], wraps it in a ByteBuffer, then writes it into MemoryRecordsBuilder, incurring unnecessary heap pressure for ByteBuffer-based payloads.

Details

AuthorLinShunKang
StatusAccepted
JIRAKAFKA-14945
WikiView on Apache Wiki
Created2022-09-25
Last Modified2023-06-21
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.