I'm a Systems Reliability and DevOps engineer for Netdata Inc. When not working, I enjoy studying linguistics and history, playing video games, and cooking all kinds of international cuisine.
Is it faster? Almost always, there's less protocol overhead, and the encoding and decoding is almost always less complex than for JSON.
The thing is though, does that actually matter? Unless you're sending pretty significant amounts of data, that efficiency difference is not likely to matter much for your use case, and JSON is generally easier to work with in most cases.
Personally, I prefer YAML over both unless efficiency really matters, because:
The short-form representation of YAML is marginally more efficient than JSON (it needs fewer quotation marks).
The long-form representation of YAML is easier for most people to read than JSON, making it a bit easier to debug.
YAML still supports custom data type representations like protobufs do.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Is it faster? Almost always, there's less protocol overhead, and the encoding and decoding is almost always less complex than for JSON.
The thing is though, does that actually matter? Unless you're sending pretty significant amounts of data, that efficiency difference is not likely to matter much for your use case, and JSON is generally easier to work with in most cases.
Personally, I prefer YAML over both unless efficiency really matters, because: