stevan / Muesli

Like Sereal, but not as good
4 stars 0 forks source link

Sereal-alike serialization at JSON functionality #2

Open tsee opened 9 years ago

tsee commented 9 years ago

Hi Stevan,

I understand that you're working on this for learning and prototyping. However, I've actually seriously considered writing a JSON-subset-of-sereal-functionality kind of encoder/decoder in the past that uses the same tricks as Sereal for performance. In fact, such a thing could conceivably be a bit speedier than Sereal itself because it wouldn't have to do as much book keeping*. It could use the same structure that Sereal uses or invent a different set of tags. With less functionality, one could achieve greater compactness by packing more information (more lengths, etc) into the tag byte. Of course, for that to be useful, it'd have to be written in C. Also, there's already MessagePack and BSON. While those might be a tad less efficient than Sereal (and thus a JSON-Sereal subset would likely win by a little bit), they're at least established and aren't "NIH".

--Steffen

stevan commented 9 years ago

Yeah, this whole repo is mostly just for learning and the "JSON-subset-of-Sereal" is mostly cause I didn't want to deal with the weirder bits of Sereal (weakrefs, scalar refs, etc.) and have it cloud my learning.

But that said, who knows, it wouldn't be the first time something I hacked together for lolz became a useful tool :)