cpp-serializers icon indicating copy to clipboard operation
cpp-serializers copied to clipboard

Avro benchmark numbers are not realistic at all

Open amitv87 opened this issue 6 years ago • 2 comments

function ** avro_serialization_test** is not at all efficient. As can be seen, for every encode / decode new resources are initialised, not an optimal technique.

Also the the default avro::InputStream and avro::OutputStream implementations are very rudimentary. Best to use a custom implementation.

    for (size_t i = 0; i < iterations; i++) {
        auto out = avro::memoryOutputStream();
        auto encoder = avro::binaryEncoder();
        encoder->init(*out);
        avro::encode(*encoder, r1);

        auto in = avro::memoryInputStream(*out);
        auto decoder = avro::binaryDecoder();
        decoder->init(*in);
        avro::decode(*decoder, r2);
    }

I found avro to be as performant as protobuf after making necessary changes

amitv87 avatar Apr 30 '18 08:04 amitv87

Thanks for the information. I'll try your suggestion.

thekvs avatar Apr 30 '18 08:04 thekvs

The repo was very helpful for quick evaluation of various codecs, good work mate.

amitv87 avatar Apr 30 '18 19:04 amitv87