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 2017 MacBook Pro (3.1 GHz Intel Core i5):

BenchmarkAverage time (ms)
Chr.AvroConfluent.Apache.Avro
array[double]
deserialization
1,000,000 iterations
217.578n/a
serialization
1,000,000 iterations
290.528n/a
array[double] (generic)
deserialization
1,000,000 iterations
n/a357.041
serialization
1,000,000 iterations
n/a552.456
array[double] (specific)
deserialization
1,000,000 iterations
n/a427.759
serialization
1,000,000 iterations
n/a530.058
boolean
deserialization
10,000,000 iterations
44.248218.248
serialization
10,000,000 iterations
91.741354.362
double
deserialization
10,000,000 iterations
232.562407.173
serialization
10,000,000 iterations
358.408758.225
fixed[12]
deserialization
10,000,000 iterations
186.920n/a
serialization
10,000,000 iterations
176.214n/a
fixed[12] (generic)
deserialization
10,000,000 iterations
n/a553.247
serialization
10,000,000 iterations
n/a491.722
fixed[12] (specific)
deserialization
10,000,000 iterations
n/a881.176
serialization
10,000,000 iterations
n/a261.225
fixed[2048]
deserialization
1,000,000 iterations
556.955n/a
serialization
1,000,000 iterations
813.730n/a
fixed[2048] (generic)
deserialization
1,000,000 iterations
n/a651.146
serialization
1,000,000 iterations
n/a1440.562
fixed[2048] (specific)
deserialization
1,000,000 iterations
n/a716.324
serialization
1,000,000 iterations
n/a866.015
float
deserialization
10,000,000 iterations
186.185392.221
serialization
10,000,000 iterations
266.083534.501
int
deserialization
10,000,000 iterations
143.195356.727
serialization
10,000,000 iterations
212.832488.547
long
deserialization
10,000,000 iterations
228.732497.893
serialization
10,000,000 iterations
379.233617.385
map[double]
deserialization
1,000,000 iterations
416.796n/a
serialization
1,000,000 iterations
359.202n/a
map[double] (generic)
deserialization
1,000,000 iterations
n/a534.978
serialization
1,000,000 iterations
n/a570.418
map[double] (specific)
deserialization
1,000,000 iterations
n/a605.435
serialization
1,000,000 iterations
n/a608.235
record
deserialization
1,000,000 iterations
647.625n/a
serialization
1,000,000 iterations
1311.111n/a
record (generic)
deserialization
1,000,000 iterations
n/a590.830
serialization
1,000,000 iterations
n/a427.407
record (specific)
deserialization
1,000,000 iterations
n/a318.839
serialization
1,000,000 iterations
n/a283.461
string
deserialization
10,000,000 iterations
616.576749.068
serialization
10,000,000 iterations
835.4191213.418

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

Chr.Avro