Open Severus1992 opened 4 years ago
we aren't planning to prioritize this in the near future. if you have a specific recommendation, feel free to open a PR to demonstrate the suggested API. this would be a breaking change, and would require a version bump to 2.0.
Given confluent-kafka-dotnet
is wrapping librdkafka
I am not sure how feasible this suggestion is.
An approach which could work would be to change ISerializer
and IAsyncSerializer
to return ArraySegment<byte>
rather than byte[]
. This would at least allow apps to use pooled arrays or circular buffers, to achieve something closer to zero-allocation serialization when publishing to Kafka. The ArraySegment
can easily map to a call to SafeKafkaHandle.Produce
which accepts an array, an offset and a length
Hello! You are planning a transition to a new Serialization context with IBufferWritter and DeserializationContext with ReadOnlySequence for zero-allocation ?