Does anyone have any information on the performance characteristics of Protocol Buffers versus BSON (binary JSON) or versus JSON in general?
These seem like good binary protocols for use over HTTP. I'm just wondering which would be better in the long run for a C# environment.
Here's some info that I was reading on BSON and Protocol Buffers.
Protocol buffers are much faster than JSON. JSON is lightweight and is faster than other serialization techniques like pickling. Protobuf schemas are encoded along with data; it ensures that signals don't get lost between applications. Language interoperability.
In particular, it was designed to be smaller and faster than XML. Protocol Buffers are widely used at Google for storing and interchanging all kinds of structured information. The method serves as a basis for a custom remote procedure call (RPC) system that is used for nearly all inter-machine communication at Google.
Protocol buffers are a combination of the definition language (created in . proto files), the code that the proto compiler generates to interface with data, language-specific runtime libraries, and the serialization format for data that is written to a file (or sent across a network connection).
Protobuf messages were 9% smaller than JSON messages and they took only 4% less time to be available to the JavaScript code.
This post compares serialization speeds and sizes in .NET, including JSON, BSON and XML.
http://james.newtonking.com/archive/2010/01/01/net-serialization-performance-comparison.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With