This article is a mirror article of machine translation, please click here to jump to the original article.

View: 74157|Reply: 6

[Source] Comparison of Protobuf and JSON performance under .NET platform

[Copy link]
Posted on 7/15/2019 10:27:37 PM | | | |
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:

.net/c# Google Protocol Buffers Quick Start
https://www.itsvse.com/thread-3626-1-1.html
(Source: Architect_Programmer)
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, pleaseReply






Previous:Java kryo/protobuf/protostuff serialization or JSON performance comparison
Next:SEO settings such as title, keywords, description, etc. of plugin pages developed by Discuz!
Posted on 7/16/2019 6:12:58 AM |
Thank you for sharing
Posted on 6/27/2020 10:03:08 PM |
Thanks for sharing
Posted on 11/11/2020 5:52:32 PM |
Thank you for sharing
Posted on 6/28/2021 2:26:33 PM |
RE: .net平台下 Protobuf 和 json 性能比较 [修改]
Posted on 10/8/2021 5:16:24 PM |
You must take a good look at Dongdong
Posted on 10/9/2021 10:07:50 PM |

Thank you for sharing
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com