bitsery
bitsery copied to clipboard
Is bitsery faster than capnp?
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?
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.