bitsery icon indicating copy to clipboard operation
bitsery copied to clipboard

Is bitsery faster than capnp?

Open siyuano opened this issue 3 years ago • 1 comments

I'm using capnp which is fast but just like everybody else I'm always looking for a faster library. I'm curious why capnp is not on the current benchmark list?

siyuano avatar Oct 24 '21 05:10 siyuano

Simple answer, because I wrote benchmarks for libraries that I was comfortable with, and a few more people contributed to the project. I would gladly accept a PR to this However, note that tests are not fair for libraries that generate their own data types, because you need to implement this interface

struct Buf {
    const uint8_t* ptr;
    size_t bytesCount;
};

class ISerializerTest {
public:
    virtual Buf serialize(const std::vector<MyTypes::Monster>& data) = 0;
    virtual void deserialize(Buf buf, std::vector<MyTypes::Monster>& res) = 0;
    virtual ~ISerializerTest() = default;
};

which means writing conversions for std::vector<MyTypes::Monster> from/to generated data types.

fraillt avatar Oct 24 '21 07:10 fraillt