What is the best JSON library in Java?
I'm very happy that JSON takes over from XML in the world of data transfer between applications and servers. I like this protocol personally much better and hope that there will be one day when XML will be gone for ever. Nowadays there are a lot of libraries that work with JSON and sometimes it's really hard to understand which one to choose. I'm very glad that i found this article where guys made a simple benchmark tests between 4 popular libraries :
If you like to see how the benchmark was done and all the tables with test data, then just follow the link. I would like
just to quickly summarise for myself and the rest end results :
- If you have an environment that deals often or primarily with big JSON files, then Jackson is your library of interest. GSON struggles the most with big files.
- If your environment primarily deals with lots of small JSON requests, such as in a micro services or distributed architecture setup, then GSON is your library of interest. Jackson struggles the most with small files.
- If you end up having to often deal with both types of files, JSON.simple came in a very close 2nd place in both tests, making it a good workhorse for a variable environment. Neither Jackson nor GSON perform as well across multiple files sizes.