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

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

问题描述

有没有人对Protocol Buffers的性能特点与BSON(二进制JSON)的任何信息或与JSON有什么看法?

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


  • 电线大小

  • 序列化速度

  • 反序列化速度

这似乎是使用HTTP上好的二进制协议。我只是想知道这将是一个C#环境从长远来看更好

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.

下面是一些信息,我正在读上的BSON 并的Protocol缓冲器

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

推荐答案

节俭是另一个Protocol Buffers的样替代为好。

Thrift is another Protocol Buffers-like alternative as well.

有来自这些技术的序列化/反序列化和线缆尺寸Java社区的良好基准: HTTP:/ /code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking

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

在一般情况下,JSON有稍大导线规格和DeSer略差,但胜在普及和方便地解释它没有源IDL的能力。最后一点是值得阿帕奇阿夫罗的正在试图解决的,它无论在性能方面跳动。

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.

微软已经发布了C#的NuGet包 Microsoft.Hadoop .Avro​​ 。

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

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

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