Kafka Client Benchmarks
Benchmarks of kafka client libraries for Golang.
Execute Benchmark
go test -timeout=5h -bench=Producer -benchmem -count 5 -benchtime=10000x > results/producer.out
go test -timeout=5h -bench=Consumer -benchmem -count 5 -benchtime=100000x > results/consumer.out
Docker File
docker-compose -p kafka -f docker-compose.yml up
Results
All the benchmarks are performed in the Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
machine with a standalone Kafka running in the docker.
Producer
All the benchmarks are performed with 10K
samples size and 5
iterations.
Microsecond / Operation
Sync Producer |
Async Producer |
 |
 |
Memory Allocation / Operation
Sync Producer |
Async Producer |
 |
 |
Bytes / Operation
Sync Producer |
Async Producer |
 |
 |
Consumer
All the benchmarks are performed with 10K
samples size and 5
iterations.
Nenosecond / Operation

Memory Allocation / Operation

Bytes / Operation

Libraries
⚠ Please note that these libraries are benchmarked against storage of sample payloads (i.e. 1, 5, and 10 KB). You are encouraged to benchmark with your custom payloads.
Credits