Maximum speed for parsing and converting Java Objects to JSON format:
- Use various parsing options
- Multi-thread parsing and conversion
- Flexibility
The qualities listed above fully describe the performance of this library.
First, let's define what kind of parser we need.
There are only two types of parsing in this library:
- Common
NodesonParser common = Nodeson.common();
- Parallel (Multi-Threaded)
NodesonParser parallel = Nodeson.parallel();
Then we can already reproduce the necessary parsing algorithms.
Let's try to parse an object to JSON and back, measuring the speed:
Common: (189ms)
String json = common.parseTo(testObject); // 178ms
TestObject converted = common.parseFrom(json, TestObject.class); // 11ms
Parallel: (109ms)
String json = parallel.parseTo(testObject); // 101ms
TestObject converted = parallel.parseFrom(json, TestObject.class); // 7ms
By clicking on this link, you can support me as a developer and motivate me to develop new open-source projects!