Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Size Smaller Than MessagePack Go Implementation #362

Open
marcsantiago opened this issue Oct 27, 2023 · 2 comments
Open

JSON Size Smaller Than MessagePack Go Implementation #362

marcsantiago opened this issue Oct 27, 2023 · 2 comments

Comments

@marcsantiago
Copy link

When pasting the JSON below into the official message pack site, it shows a significant decrease in size
https://msgpack.org/index.html

{"bar":"spam","foo":[{"spam":"ss","size":{"w":320,"h":480},"n":10,"c":1},{"spam":"ss","size":{"w":300,"h":250},"n":5,"c":1},{"spam":"ss","size":{"w":320,"h":50},"n":1,"c":1},{"spam":"v","size":{"w":-1,"h":-1},"n":20}],"l":10,"b":1}

However when using this package it always shows that the generated output is larger than it's JSON counter part. Any reason why?

Is the site applying compression as well?

@yuhj86
Copy link

yuhj86 commented Nov 20, 2023

@ToasterKTN
Copy link

I assume, there is the type saved in the []byte. When u store it as json, there is no type definition, its loose and will get duck typed while loading. I also assum this will make this implementation faster than a json encoding/decoding.

But thats just an assumption, i did not check the code, nor did i use it till now :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants