I am using the protobuf producer outlined here. Unfortunately, its serialization is so slow that it a bottleneck in my whole system. Specifically, it takes 1.6s to serialize 1 million messages, even though pure protobuf can serialize the same 1 million messages in 100ms.
How can I speed up serialization to avoid this 15x overhead? I would like to avoid parallelization.
My serialization is a straight-forward adaptation of the protobuf producer example, except that I enabled CacheSchemas (without this, the code is another order of magnitude slower):
Description
I am using the protobuf producer outlined here. Unfortunately, its serialization is so slow that it a bottleneck in my whole system. Specifically, it takes 1.6s to serialize 1 million messages, even though pure protobuf can serialize the same 1 million messages in 100ms.
How can I speed up serialization to avoid this 15x overhead? I would like to avoid parallelization.
How to reproduce
I put my whole experimental setup here: https://github.com/bichselb/confluent-kafka-go-performance/tree/serialization-slow
My serialization is a straight-forward adaptation of the protobuf producer example, except that I enabled
CacheSchemas
(without this, the code is another order of magnitude slower):Checklist
Please provide the following information:
v2.5.4
confluentinc/cp-kafka:7.7.1