Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark request - flexbuffers and avro #7

Closed
insanitybit opened this issue Jan 4, 2021 · 2 comments
Closed

Benchmark request - flexbuffers and avro #7

insanitybit opened this issue Jan 4, 2021 · 2 comments

Comments

@insanitybit
Copy link

The benchmarks right now compare NoProto to formats that are fairly different - either the data carries along a schema (json), or the schema is precompiled (protobuf).

I think flexbuffers and avro are probably much better comparisons, as they're both formats where the schemas can be loaded dynamically. I think it would be very interesting to see comparisons to those two.

@only-cliches
Copy link
Owner

Hey thanks for the issue, that's a good idea.

I didn't realize how much NoProto has in common with Apache Avro! I got the benchmarks together, results below:

Library Encode Decode All Decode 1 Update 1 Size (bytes) Size (Zlib)
Runtime Libs
NoProto 1057 1437 47619 12195 208 166
Apache Avro 138 51 52 37 702 336
FlexBuffers 401 855 23256 264 490 309
JSON 550 438 544 396 439 184
BSON 115 103 109 80 414 216
MessagePack 135 222 237 119 296 187
Compiled Libs
Flatbuffers 1046 14706 250000 1065 264 181
Bincode 5882 8772 9524 4016 163 129
Protobuf 859 1140 1163 480 154 141
Prost 1225 1866 1984 962 154 142

The most popular Apache Avro library ,avro-rs is disappointing from a performance perspective. There's no reason it can't be as fast as NoProto (I studied the Avro docs). I feel like the only thing making NoProto so much faster in this case is the better Rust implementation.

I feel super proud that NoProto is beating out Flexbuffers, I didn't expect that result. I'll have these benchmarks in the next release!

@insanitybit
Copy link
Author

insanitybit commented Jan 11, 2021

Yeah, avro and noproto seem sort of analagous to protobuf and capnproto, so I thought the comparison was appropriate. Very interesting to see these results - I'm in agreement that there's nothing fundamental to avro that makes it as slow as it is, really most of avro could be zero-copy even, similar to how protobuf is.

Great to see beating out flexbuffers. Pretty cool project, I really look forward to watching it.

I also wonder if that size comparison is maybe including the schema with avro? Avro by default will attach the schema to the data, but that's not fundamental - you can remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants