Open
Description
Hi!
I have profiled Kafka Rest v7.5.0 under some test load (2rps on Produce V2 endpoint with Avro format and schemas registered in Schema Registry, using schema id) and it looks like most of the time inside RecordSerializerFacade.serialize
is actually spent reinstantiating the three serializers (Avro, JsonSchema, Protobuf) (you can see how small is the portion spent actually serializing in this profiling).
It seems this is due to io/confluent/kafka/serializers/AbstractKafkaSchemaSerDe.addRuleObjectsFromServiceLoader
.
- Am I interpreting this right? Are serializers reinstantiated for each request?
- Would it be possible to reuse the same serializers for different requests? Are they thread-safe? If yes, can we maybe bind
SchemaRecordSerializerFactory
with singleton scope?
Thank you!
Metadata
Assignees
Labels
No labels