json:小于XML [英] json:smaller than XML
本文介绍了json:小于XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
据说'JSON比XML小,更快更容易解析。'
我知道它更容易解析。但它如何比xml更小?它的长度(数据长度)类似于xml。
它因为
firstName:John相当于 < firstname > John < / firstname >
?
只是好奇。
解决方案
< pre lang =text>firstName:John
< firstname> John< / firstname>
|||||||||||||||||| 123456789
123456789012345678
保存9个字符,在您的示例中。
JSON:18
xml:27
开销:50%。
里程可能会有所不同......;)
巴勃罗。
Hello,
it is said that 'JSON is smaller than XML, and faster and easier to parse.'
I know that it is easier to parse. but how it is 'smaller' than xml? its length (data length) is similar to xml.
it it because
"firstName":"John"
in json is equivalent to
<firstname>John</firstname>
?
Just curious about it.
解决方案
"firstName":"John" <firstname>John</firstname> ||||||||||||||||||123456789 123456789012345678
9 characters saved, in your example.
JSON: 18
xml: 27
overhead: 50%.
Mileage may vary... ;)
Pablo.
这篇关于json:小于XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文