几种序列化库

本文介绍了三种流行的序列化库:Google Protobuf、Google FlatBuffer和Cap’n Proto,并提供了相关链接和性能比较。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.google protocal buffer:

http://www.ibm.com/developerworks/cn/linux/l-cn-gpb/

http://www.cnblogs.com/stephen-liu74/archive/2013/01/02/2841485.html


2.Google FlatBuffer:

http://google.github.io/flatbuffers/md__benchmarks.html


3.Cap’n Proto

http://kentonv.github.io/capnproto/encoding.html


以下是性能比较:


  FlatBuffers (binary) Protocol Buffers LITE Rapid JSON FlatBuffers (JSON) pugixml
Decode + Traverse + Dealloc (1 million times, seconds)0.08302583105196
Decode / Traverse / Dealloc (breakdown)0 / 0.08 / 0220 / 0.15 / 81294 / 0.9 / 28770 / 0.08 / 3541 / 3.9 / 150
Encode (1 million times, seconds)3.2185650169273
Wire format size (normal / zlib, bytes)344 / 220228 / 1741475 / 3221029 / 2981137 / 341
Memory needed to store decoded wire (bytes / blocks)0 / 0760 / 2065689 / 4328 / 134194 / 3
Transient memory allocated during decode (KB)01131434
Generated source code size (KB)461040
Field access in handwritten traversal codetyped accessorstyped accessorsmanual error checkingtyped accessorsmanual error checking
Library source code (KB)15some subset of 38008743327


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值