I just tried MessagePack to minimise a pretty hefty web response (20,000 items, totalling 6MB).
The result was... 20MB!
After a bit of research, I've found that it's due to the nature of binary serialisers, and that JSON specific serialised can be much more efficient because they're designed to work with specifically with the JSON format.
I have since used GZip and the response is now a fantastic 600kb
Comment
I just tried MessagePack to minimise a pretty hefty web response (20,000 items, totalling 6MB).
The result was... 20MB!
After a bit of research, I've found that it's due to the nature of binary serialisers, and that JSON specific serialised can be much more efficient because they're designed to work with specifically with the JSON format.
I have since used GZip and the response is now a fantastic 600kb
Replies
So, from 6MB, to 20MB, to 600kb?
What about Brotli or Zstandard? Even smaller?
Yeah, the original response using default .NET JSON serialiser (System.Text.Json) was 6MB.
Then I had a go with MesssagePack and it was 20MB.
Then I tried GZip and got a nice 600kb.
I didn't try anything after that - 600kb is good enough for me, excellent in fact!