Why is MessagePack slower than JSON? #248
Replies: 5 comments
-
Jackson is at heart a JSON library that has bindings for other formats. In practice, most effort of the small dev community goes into the JSON use cases. If you would like to volunteer to provide patches to improve the Jackson messagepack support, they will be appreciated. NB msgpack-jackson is not a Jackson maintained library. It is maintained by the https://github.com/msgpack team so maybe you should redirect this discussion to them. If you raw performance is what you need, would you not consider using a low level library like msgpack-core? A specialised lib will usually beat the performance of a generalised lib like Jackson. |
Beta Was this translation helpful? Give feedback.
-
@john-boxcar There is room for improvement there: generally MessagePack performance ought to be similar to Please note that |
Beta Was this translation helpful? Give feedback.
-
My apologies to you both. I was under the mistaken belief that this was the correct repository to post in. I will re-post this in the appropriate repository. Thank you for your time. |
Beta Was this translation helpful? Give feedback.
-
Re-posted here: msgpack/msgpack-java#841 |
Beta Was this translation helpful? Give feedback.
-
FWTW, this project: https://github.com/FasterXML/jackson-benchmarks reproduces your findings, f.ex: https://github.com/FasterXML/jackson-benchmarks/blob/2.18/results-pojo-2.17-home.txt has read perf:
so JSON deserialization is about 60% faster; and serialization:
almost 150% faster. These are small documents (300 bytes JSON if I remember), difference for bigger content probably less pronunced. But other binary formats (Smile, CBOR in particular, and for reading, Avro) are faster than JSON. |
Beta Was this translation helpful? Give feedback.
-
I wrote this crude benchmark to compare the performance of JSON and MessagePack. Consistently, JSON is faster during serialization, faster on deserialization, and MessagePack produces smaller payloads. Based on what I've read, I was expecting MessagePack to be faster during both serialization and deserialization in addition to producing smaller payloads. Are my expecations unrealistic or is there room for improvement here? On my machine, I'm getting this output:
Here are my dependency versions:
Here is the code:
Beta Was this translation helpful? Give feedback.
All reactions