Skip to content
Pyrula
Pre-release: the packages are not on PyPI yet, so pip install does not resolve. Build from source to try it today.

Benchmarks

Records per second, higher is better. Local confluentinc/cp-kafka:7.7.0, Apple M1 Max, 12 partitions, median of three runs; rows move 10-20% between runs. pyrula rows use the bulk produce and batch poll APIs. Bold is the faster of pyrula and confluent. No Linux run is published yet.

The harness is benchmarks/kafka/benchmark.py; run it against your own broker:

Terminal window
python benchmarks/kafka/benchmark.py --broker localhost:9092

--help lists the suites and sizes; the Avro suites need --schema-registry.

Near the broker’s ceiling (~155-175 MB/s), so the faster clients converge.

Suitepyrulaconfluentaiokafkakafka-pythonvs confluent
Produce bytes140k144k84k6.1k0.99x
Produce bytes, acks=1150k146kn/an/a1.02x
Idempotent produce, 6 partitions157k149kn/an/a1.09x
Produce JSON125k115k77k5.4k1.08x
Transactional produce91k64kn/an/a1.41x
Produce Avro128k125kn/an/a1.02x
Consume records138k126k103k6.4k1.02x
Consume raw bytes165k156kn/an/a1.00x
Consume raw bytes, 12 partitions146k156kn/a6.4k1.04x
Consume + JSON decode137k131k82k5.8k1.19x
Consume Avro108k110kn/an/a1.00x

JSON and Avro rows encode a small dict, so records are under 128 B.

Suitepyrulaconfluentaiokafkakafka-pythonvs confluent
Produce bytes1.12M1.08M194k31k1.04x
Produce bytes, acks=11.06M962kn/an/a1.10x
Idempotent produce, 6 partitions943k968kn/an/a0.98x
Produce JSON1.07M403k189k34k2.75x
Transactional produce210k138kn/an/a1.50x
Produce Avro1.87M427kn/an/a4.43x
Consume records769k731k474k41k1.06x
Consume raw bytes939k907kn/an/a1.06x
Consume raw bytes, 12 partitions872k875kn/a41k1.04x
Consume + JSON decode1.24M113k299k50k10.2x
Consume Avro1.04M144kn/an/a7.7x

n/a: not measured (kafka-python has no transaction API).

View this page as Markdown