- The benchmark code is present in the laboratory directory of the repository.
- We don’t compare to Capt’n Proto because it does not have a stable web-based implementation, at least not one that has the features that make it so fast natively, so there is nothing to compare.
- Flatbuffers are fast but have a notoriously awful API to work with while also creating their own non-standard data structures in languages like C++. Bebop generates standard type-safe code.
- Bebop doesn’t try to compress data other than strings. This is because we don’t want to be responsible for compressing trailing zeroes when faster compression algorithms exist that can be down after encoding. Also most data is tiny.
- Bebop supports discriminated unions and has a much more robust type system than Flatbuffers.
- We’re not convincing anyone to use our stuff. It was made for us and open sourced because it was useful; we don’t need people ripping out their current serializers if there’s no pressure to do so.
But yes, it's a lot of work and they probably should document what the trade-offs are that they have made.
I would guess the high speed is the triad of
length encoding with a header vs searching for delimiters
using what they call structs for benchmarks (no repeatedly sending the field name)
how much you trade off safety/sanity checks for performance
Oh, and keeping ints little endian.
A link to the benchmark code and description of the data would be nice.
It also doesn't show data for FlatBuffer, which is often a lot faster and leaner than ProtoBuf, or for Capt'n Proto.
ProtoBuf is not exactly known for amazing performance or very optimal client implementations across the various languages.
By all means, create a new serialization format, why not. But with so many options to chose from, I would require really strong justification internally.