Live data from Hacker News

It's like JSON. but fast and small.

msgpack.org

101–103 of 103 posts

Re: It's like JSON. but fast and small.

#101

This is just an implementation of a binary encoded Property Tree. And 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 relati…

As far as redundant kv encoding isn't gzip good enough? Sure, it's more generalized, but tailored compression schemes often aren't the win they're touted as. Additionally, they can't exploit scenarios where multiple pairs are repeated (for instance gzip would compress [{x: 1}, {x: 1}, {x: 1}, ...] far more efficiently.

Actually, Apple's implementation does handle multiple pair redundancy since all CFArrays and CFDictionarys added to the PList are uniqued.

Obviously, further GZIPing the result will always make it more compact but GZIP on uniqued result is likely to result in a more compact representation than GZIP on the non-uniqued result.

Re: It's like JSON. but fast and small.

#102
post #45
post #33

Earlier quoted context omitted.

A lot of these bit shaving goose chases would be short circuited if browsers exposed zlib !

What would be the advantage of exposing it instead of compressing the data transparently in the background. (Like it is done already.)

The situation is pretty sporadic with http, tls and websockets. On plain http it mostly works from server to client, but that's about the only usable case.

Re: It's like JSON. but fast and small.

#103

Earlier quoted context omitted.

Is was a fun project actually. https://github.com/creationix/msgpack-js-browser

Question out of curiosity: did you notice any performance improvements from using DataView and ArrayBuffer?

I never used the "official" js codec because it didn't exist when I started. My codec has been optimized for nodejs and does rather well there. I recently did a jsperf for the browser port (msgpack-js-vs-json) and while slower than the nodejs version, it looks a bit faster than the "official" one.
Post reply on HN