Performance and benchmarks

To ensure that changes to Chr.Avro don’t introduce major performance regressions (and to highlight areas where performance could be improved), we maintain a set of rudimentary benchmarks to test serialization throughput.

Each benchmark runs five times, and we take the average time of those runs. These results were collected on a GitHub Actions worker running Ubuntu:

BenchmarkAverage time (ms)
Chr.AvroConfluent.Apache.Avro
array[double]
deserialization
100,000 iterations
20.214n/a
serialization
100,000 iterations
41.771n/a
array[double] (generic)
deserialization
100,000 iterations
n/a38.513
serialization
100,000 iterations
n/a62.156
array[double] (specific)
deserialization
100,000 iterations
n/a49.035
serialization
100,000 iterations
n/a62.660
boolean
deserialization
1,000,000 iterations
2.31134.814
serialization
1,000,000 iterations
6.90267.869
double
deserialization
1,000,000 iterations
30.92458.412
serialization
1,000,000 iterations
42.508110.496
fixed[12]
deserialization
1,000,000 iterations
19.187n/a
serialization
1,000,000 iterations
25.234n/a
fixed[12] (generic)
deserialization
1,000,000 iterations
n/a73.483
serialization
1,000,000 iterations
n/a74.433
fixed[12] (specific)
deserialization
1,000,000 iterations
n/a88.462
serialization
1,000,000 iterations
n/a34.325
fixed[2048]
deserialization
100,000 iterations
59.988n/a
serialization
100,000 iterations
63.224n/a
fixed[2048] (generic)
deserialization
100,000 iterations
n/a63.525
serialization
100,000 iterations
n/a63.760
fixed[2048] (specific)
deserialization
100,000 iterations
n/a68.915
serialization
100,000 iterations
n/a63.502
float
deserialization
1,000,000 iterations
22.99854.323
serialization
1,000,000 iterations
32.75678.465
int
deserialization
1,000,000 iterations
9.65846.015
serialization
1,000,000 iterations
18.91164.618
long
deserialization
1,000,000 iterations
12.96959.512
serialization
1,000,000 iterations
34.38076.131
map[double]
deserialization
100,000 iterations
37.479n/a
serialization
100,000 iterations
41.359n/a
map[double] (generic)
deserialization
100,000 iterations
n/a51.784
serialization
100,000 iterations
n/a64.784
map[double] (specific)
deserialization
100,000 iterations
n/a58.827
serialization
100,000 iterations
n/a83.686
record
deserialization
100,000 iterations
97.870n/a
serialization
100,000 iterations
87.352n/a
record (generic)
deserialization
100,000 iterations
n/a60.221
serialization
100,000 iterations
n/a39.633
record (specific)
deserialization
100,000 iterations
n/a33.984
serialization
100,000 iterations
n/a33.804
string
deserialization
1,000,000 iterations
74.75999.088
serialization
1,000,000 iterations
79.096125.743

In the future, we’re hoping to expand the benchmarks to test more complex situations as well as non-.NET libraries.

Chr.Avro