Spray's Json parser vs. Argonaut's vs. Play's in a head-to-head battle to the death.
Yesterday I blogged about a simple benchmark between Spray’s JSON parser and Argonaut’s JSON parser. The results were pretty clear that Argonaut’s more efficient. After I posted it, @David Ross reminded me that Play has a pretty substantial JSON library as well. So, I added it to the mix. It turns out, I should probably be using that one, if I want decent performance. Of course, Play’s JSON library is based off of Jackson at the core, which is the fastest JSON library for Java I’ve ever used, so its speed isn’t that surprising.
The setup is the same as yesterday, and you can view the code in the same Github repository. The results are:
For spray-json:
For Argonaut:
For Play Json:
The averages are (ignoring the first run of each):
- spray-json: 1,089 ms
- Argonaut: 324 ms
- Play Json: 179 ms
Meaning that:
- Play Json is 1.8 times faster than Argonaut, and 6.1 times faster than spray-json
Please collect your bag of salt on the way out.