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.08 | 302 | 583 | 105 | 196 |
Decode / Traverse / Dealloc (breakdown) | 0 / 0.08 / 0 | 220 / 0.15 / 81 | 294 / 0.9 / 287 | 70 / 0.08 / 35 | 41 / 3.9 / 150 |
Encode (1 million times, seconds) | 3.2 | 185 | 650 | 169 | 273 |
Wire format size (normal / zlib, bytes) | 344 / 220 | 228 / 174 | 1475 / 322 | 1029 / 298 | 1137 / 341 |
Memory needed to store decoded wire (bytes / blocks) | 0 / 0 | 760 / 20 | 65689 / 4 | 328 / 1 | 34194 / 3 |
Transient memory allocated during decode (KB) | 0 | 1 | 131 | 4 | 34 |
Generated source code size (KB) | 4 | 61 | 0 | 4 | 0 |
Field access in handwritten traversal code | typed accessors | typed accessors | manual error checking | typed accessors | manual error checking |
Library source code (KB) | 15 | some subset of 3800 | 87 | 43 | 327 |