At $work, we are looking to replace JSON encoding with another format, to increase encode/decode speed and required storage size.
Requirements, in order of importance for our use case, YMMV:
- no schema requirement: data is JSON-compatible, deeply nested in cases, but we don't have a schema to start from;
- smallest size: we store the objects in memory on Redis DB's, so size is the main factor;
- fast decode: we can trade slower encode speed for size, but decode should be fast;
- language support: stack is Perl, Go, and JavaScript. PHP is a plus, but not required.
We are testing msgpack, cbor, sereal, and others, but here I wanted to compare just sereal (the current forerunner) with the new VPack from ArangoDB project.
We used the sample files from VPack project tests/jsonSample/, and I took the best results for VPack from the Performance.md file, last column, VPack-c. Please note: we are only comparing size at the moment (it was enough for our use case, where size is more important, YMMV)
Please don't make this a "mine is better" competition, this is based on our criteria for our use case
If you find a bug on our methodology I would appreciate a note here or on @pedromelo.
There are two columns above, defaults and no compression, with sereal without any compression. It still gains some space, but yes, this was not a "mine is smaller", just comparing two tools.
Doing Message pack next...