golang -- 序列化 msgpack & json

If you look at the memcached tests, go performs very well when using msgpack but falls behind both Ruby and Perl when using JSON.

go的序列化,通信中常用的格式:msgpack 和json

但go 标准库对json 的处理很慢,用msgpack 就快得多。

It's like JSON.
but fast and small.

MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small integers are encoded into a single byte, and typical short strings require only one extra byte in addition to the strings themselves.

https://github.com/ugorji/go 4

例子 http://my.oschina.net/1123581321/blog/191282 7

Relative Articles