In age of remakes, sequels, reboots and such things I decided to make my own :) 6 years ago I wrote a pretty big blog post about Scala Serialization. I received some positive feedback and some proposal - which libraries to include to benchmark. I wanted to follow up on it for a long time, but… didn’t have enough time and motivation to go back. And now it’s time :)
In our era of Internet, JSON is probably the most used data format. It makes the choice of the library to work with JSON (or any other data format) pretty much important: CPU cycles spent on serialization/deserialization may save your bill and environment.
Even though the focus of this benchmark is on Scala libraries, I actually benchmark 50/50 Scala and Java libraries.
A full list of formats and libraries in benchmark:
- JSON format: Jackson, Jsoniter, uPickle and Circe.
- Protocol Buffers (protobuf): ScalaPB and protobuf-java.
- Thrift: libthrift.
- MessagePack: uPickle.
- Cap’n Proto: capnproto-java.
- Boopickle. Custom binary format without backward-compatibility.
- Kryo: Chill.
- CBOR and Smile via Jackson.
- Java serialization just for reference.
I dropped few libraries that I benchmarked previously:
- kryo-macros: it’s not maintained, apparently, the library was published on bintray, which is shutdown.
- Scrooge: doesn’t work with
- pickling: repo is archived, last version is for scala-library
TBD: Why is it important that I use DTO and events?