XML, JSON, PB comparison

Source: Internet
Author: User

Recently, the company will be the original project from PHP to generate XML into the Python-generated PB (Protocol Buffer) structure, previously did not contact PB, from the online search for a tutorial. It feels good.

I will now summarize:

  Xml Json PB
Data structure Support Complex structure Simple structure Complex structure
How data is saved Text Text Binary
Data Save Size Big So so Small
Analytic efficiency Slow So so Fast
Language support Level Very much Many C++/java/python/golang
Development difficulty? Tedious? Tedious Simple Simple
Learning costs Low Low Low
Scope of application Data exchange Data exchange Data exchange
Read Sex Good So so Poor

PB read performance is poor, than the need to develop an interface to parse into a JSON format for viewing. However, this is one of the reasons why it is relatively small file. And most important of all, he just needs to maintain the documentation, which is nice to compare with his format.

If you use Python and

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.