协议缓冲区与JSON或BSON [英] Protocol Buffers versus JSON or BSON

查看:127
本文介绍了协议缓冲区与JSON或BSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都有关于协议缓冲区与BSON(二进制JSON)或JSON相比的性能特征的任何信息吗?





  • 序列化速度

  • 反序列化速度



<这些看起来像是通过HTTP使用的良好的二进制协议。我只是想知道从C#环境的长远来看,哪个更好。



这里是一些信息,我在 BSON 和< a href =http://code.google.com/apis/protocolbuffers/docs/overview.html =nofollow noreferrer>协议缓冲区。

解决方案

Thrift 是另一个类似协议缓冲区的替代方案



这些技术的序列化/反序列化和连线尺寸方面,Java社区有很好的基准: http://code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking



一般来说,JSON的线径稍大,DeSer稍差,但是无处不在,无需源IDL即可轻松解释。最后一点是 Apache Avro 试图解决的问题,它在性能方面。



Microsoft已发布了一个C#NuGet包 Microsoft.Hadoop.Avro


Does anyone have any information on the performance characteristics of Protocol Buffers versus BSON (binary JSON) or versus JSON in general?

  • Wire size
  • Serialization speed
  • Deserialization speed

These seem like good binary protocols for use over HTTP. I'm just wondering which would be better in the long run for a C# environment.

Here's some info that I was reading on BSON and Protocol Buffers.

解决方案

Thrift is another Protocol Buffers-like alternative as well.

There are good benchmarks from the Java community on serialization/deserialization and wire size of these technologies: http://code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking

In general, JSON has slightly larger wire size and slightly worse DeSer, but wins in ubiquity and the ability to interpret it easily without the source IDL. The last point is something that Apache Avro is trying to solve, and it beats both in terms of performance.

Microsoft has released a C# NuGet package Microsoft.Hadoop.Avro.

这篇关于协议缓冲区与JSON或BSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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