What the hell is protobuf?

Comparing encoding/decoding performance. Less than better.

What’s protocol buffers?

It's description from Google official page:Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.

Why do we need another format for data serialization?

Me after using protobufs in AWS services

Benchmarks (as we like it)

BenchmarkSerializeToJson-8             3000000        527 ns/op      112 B/op        1 allocs/op
BenchmarkSerializeToJsonStream-8 3000000 463 ns/op 0 B/op 0 allocs/op
BenchmarkSerializeToProtobuf-8 10000000 197 ns/op 80 B/op 1 allocs/op
BenchmarkUnserializeToJson-8           1000000       2183 ns/op      448 B/op       11 allocs/op
BenchmarkUnserializeToJsonStream-8 500000 2500 ns/op 1216 B/op 15 allocs/op
BenchmarkUnserializeToProtobuf-8 3000000 461 ns/op 272 B/op 9 allocs/op

The problem




Software Developer from VK

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store