就解析(序列化、反序列化)和通过网络发送数据包而言,是否有任何好的估计二进制和 xml 序列化之间的性能差异?
Nope.
这在很大程度上取决于 XML 文档本身内部的数据类型。如果您有大量结构化数据,XML 的开销将会很大。例如,如果您的数据如下所示:
<person>
<name>Dave</dave>
<ssn>000-00-0000</ssn>
<email1>xxxxxx/email1>
</person>
...
与使用如下所示的 XML 文档相比,您的开销会大得多:
<book name="bible">
In the beginning God created the heavens and the earth.
Now the earth was formless and empty ...
And if any man shall take away from the words of the book of this prophecy, God shall take away his part out of the book of life, and out of the holy city, and from the things which are written in this book. He which testifieth these things saith, Surely I come quickly. Amen. Even so, come, Lord Jesus.
</book>
所以这确实不是一个公平的问题。这在很大程度上取决于您打算发送的数据,以及如何/是否压缩它。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)