Protobuf is an open-source project of Google that serializes and deserializes user data, and Google claims that Google's data communication is done using this serialization method. It is much smaller than the XML format, and even much smaller than the binary data format.
The Protobuf format protocol is platform-independent like XML, allowing communication between different platforms with few resources and extensibility to add new data to older protocols
Protobuf runs in java and C++, and Protobuf-net is of course a port of Protobuf in the .net environment.
About the Protobuf tutorial I wrote before, here's what I wrote:
Because, my serverThe requirements for performance and storage consumption are highSo, it's not like using json to serialize and deserialize object data, remember that Protobuf is faster than json serialization and deserialization, and takes up less space, so let's do a small test here.
Here we use the "protobuf-net" library, no need to define the .proto file, Java uses the protostuff class library, or you can do not define the .proto file.
Let's take a look at the test renderings first:
Test results:Protobuf is about 500 milliseconds faster than JSON serialization and deserialization, json is mainly slower than the inverse sequence.
Test code:
Source:
Tourists, if you want to see the hidden content of this post, please Reply
|