Jump to content

Compressing JSON


NotionCommotion

Recommended Posts

I am using JSON to pass data between two non-browser machines, and would like to compress it, and am considering CBOR and MessagePack.  Does anyone have any experience with either, or any recommendations how to proceed?  Looking at both their sites, I found that http://cbor.io/ includes a link to https://github.com/2tvenom/CBOREncode and http://msgpack.org/ includes linkes to https://github.com/rybakit/msgpack.php and https://github.com/msgpack/msgpack-php. Google searches found other gitub solutions as well.  Any experience with any of them?  Thanks

Link to comment
Share on other sites

I'd just go with gzip/zlib encoding. Do you want to use a third-party library for a particular reason?

 

Whatever it is, try them out and see what you get. Consider runtime, memory usage, and of course compression ratios.

 

My reason for wanting to use these two is that the other non-PHP machine supports them.  https://github.com/nlohmann/json.

Link to comment
Share on other sites

Then it's also likely they would have zlib...

 

If you're limited to CBOR or MessagePack then your hands are tied. That CBOR implementation looks nicer to use, but I think it would be more important to decide for the C side of it first.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.