What is the fastest way to deserialize JSON in java
java, json
Solution
Mapping parsed JSON to Java bean involves additional steps, so using the raw interface (e.g. the streaming API of Jackson) will be faster. This way, you can also read until have what you need and stop parsing.
In response to @sikorski From Jackson Wiki:
Data binding is built using Streaming API as the underlying JSON reading/writing system: as such it has high-performance [...], but has some additional overhead compared to pure streaming/incremental processing
This is pretty much inevitable. If you are writing a generic Jackson parser, you obviously can't use custom types in it. Therefore it follows that you'll have to construct the custom type after you read the JSON with the generic parser, and hence the generic parser will be faster. It's worth noting though that such overhead is very small and almost never something you need to optimize away.
Problem
I'm wondering what is the fastest way to parse json in JAVA ? - Getting a default object graph using the library built in Array, and Object objects - Getting a custom object graph using your own java bean Thanks