It's like JSON. but fast and small.
msgpack.org
It's like JSON. but fast and small.
1–10 of 103 posts
Re: It's like JSON. but fast and small.
#2Re: It's like JSON. but fast and small.
#3O_o didn't this make news a long time ago?
Re: It's like JSON. but fast and small.
#4msgpack (and bson too) always seemed a bit odd to me though. If you need binary packing, why not use protobufs or thrift?
Re: It's like JSON. but fast and small.
#5Re: It's like JSON. but fast and small.
#6Re: It's like JSON. but fast and small.
#7Someone at ebay already compared all the protocols and ended up advising json instead: http://news.ycombinator.com/item?id=3967157
Re: It's like JSON. but fast and small.
#8I needed to transfer data from a python script to a ruby script. Ended up looking like this:
Python script:
import msgpack
msg = msgpack.packb(some_data)
sys.stdout.write(msg)
Ruby script: require 'msgpack'
msg = `python my_script.py`
some_data = MessagePack.unpack(msg)Re: It's like JSON. but fast and small.
#9Equally, "it's like JSON, but binary and human-unfriendly".
Re: It's like JSON. but fast and small.
#10And not the best implementation out there since it lacks the redundant key/value elimination that more compact serialization formats use. Consider an array of maps where each of the maps have the same keys. By eliminating the redundant keys (have each subsequent occurrence simply reference earlier occurrences) you can halve the encoded data size relative to implementations without redundant elimination.
It also lacks a canonical string encoding. All strings are saved as raw binary data making it terrible for data interchange between environments with different string encodings.
C/C++/Objective-C users have many better options than this. In Mac/iOS/Cocoa/CoreFoundation, you can use Apple's Binary PList which is open sourced here:
http://www.opensource.apple.com/source/CF/CF-476.10/CFBinaryPList.c
In non-Apple C/C++ environments, you can use the open source implementation of Apple's PList here: https://github.com/JonathanBeck/libplist