News for hackers. Stuff that matters.
Re:It's like JSON. but fast and small. by NelsonMinar on Saturday December 29, 2012 @11:40AM (#4982537)
I did a quick test on some JSON data I use in my webapps; ~100k-1M blobs, mostly numbers. gzipped MessagePack data was just about the same size as gzipped JSON data. If you care about size on the wire over HTTP, then MessagePack may not be an improvement. It's amazing how well gzip compresses the stupid ASCII encoding of numbers in JSON.
Re:It's like JSON. but fast and small. by Too on Saturday December 29, 2012 @12:26PM (#4982668)
Doesn't have to be stupid. A normal integer in binary representation ALWAYS consumes 4 bytes. With string representation you have 1000 numbers that will beat that as they only need <=3 characters. Numbers in that range are actually used very frequently.
Re:It's like JSON. but fast and small. by pjscott on Saturday December 29, 2012 @01:20PM (#4982868)
Funny you should mention that. Msgpack uses a variable-length binary encoding for integers. It can, for example, fit integers in the interval [-32, 127] into a single byte. And unlike that fixed four-byte encoding you mention, it can also handle 64-bit integers.

(I'm not disagreeing with you, or anything. I just like talking about binary encodings.)

Re:It's like JSON. but fast and small. by jspthrowaway2 on Saturday December 29, 2012 @05:18PM (#4983706)
There is also zigzag encoding, something Protocol Buffers (I believe) introduced for general usage. Thrift later copied it for the compact encoding.

It's pretty interesting.

Re:It's like JSON. but fast and small. by rorrr on Saturday December 29, 2012 @09:18PM (#4984291)
> A normal integer in binary representation ALWAYS consumes 4 bytes

That's not true. Most languages have 1-byte integers, 2-byte integers and 4-byte integers.

Re:It's like JSON. but fast and small. by reeses on Sunday December 30, 2012 @01:03AM (#4984852)
Truly awesome languages use binary-coded decimal.

Ok, I'll show myself out.