KIP-863 — Reduce CompletedFetch#parseRecord() memory copy
Accepted Kafka 3.6 ClientConsumer
Adds an overloaded `Deserializer#deserialize(String, Headers, ByteBuffer)` method and updates `CompletedFetch#parseRecord()` to use `ByteBuffer` directly instead of converting to `byte[]` before deserialization. The current implementation calls `Utils.toArray(ByteBuffer)` on every record's key and value during fetch processing, causing unnecessary heap allocation and memory copy for every consumed record.
Details
| Author | LinShunKang |
| Status | Accepted |
| Kafka Version | 3.6 |
| JIRA | KAFKA-14944 |
| Wiki | View on Apache Wiki |
| Created | 2022-08-21 |
| Last Modified | 2025-01-09 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.