有二进制和XML序列化之间的任何perfomormance区别? [英] Is there any perfomormance differences between binary and XML serialization?

查看:139
本文介绍了有二进制和XML序列化之间的任何perfomormance区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这两种解析(序列化,反序列化),并通过网络发送的数据包而言是存在的二进制和XML序列化的性能差异的良好估计?

in terms of both parsing (serializing, deserializing) and sending packets over the network is there any good estimation of performance differences between binary and xml serialization?

推荐答案

不。

这在很大程度上取决于是XML文档本身里面有什么样的数据。如果你有很多的结构化数据,XML的开销会很大。例如,如果你的数据是这样的:

It depends highly on what sort of data is inside the XML document itself. If you have a lot of structured data, the overhead for XML will be large. For example, if your data looks like:

<person>
  <name>Dave</dave>
  <ssn>000-00-0000</ssn>
  <email1>xxxxxx/email1>
</person>
...

您将有更多的开销比如果你有一个XML文件看起来像:

You'll have a lot more overhead than if you have an XML document that looks like:

<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>



所以,这不是一个真正的公平的问题。这在很大程度上取决于您要发送的数据,以及如何/如果你压缩了。

So it's not really a fair question. It depends highly on the data YOU intend to send, and how/if you're compressing it.

这篇关于有二进制和XML序列化之间的任何perfomormance区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆